Testing pretty print produces good html
Signed-off-by: Mike Terzo <mike@terzo.org>
This commit is contained in:
@@ -14,7 +14,7 @@ from puppetboard import utils
|
|||||||
from puppetboard import app
|
from puppetboard import app
|
||||||
from puppetboard.app import NoContent
|
from puppetboard.app import NoContent
|
||||||
|
|
||||||
|
from bs4 import BeautifulSoup
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
@@ -54,6 +54,15 @@ def test_get():
|
|||||||
assert x == utils.get_or_abort(test_get_or_abort)
|
assert x == utils.get_or_abort(test_get_or_abort)
|
||||||
|
|
||||||
|
|
||||||
|
def test_pretty_print():
|
||||||
|
test_data = [{'hello': 'world'}]
|
||||||
|
|
||||||
|
html = utils.prettyprint(test_data)
|
||||||
|
soup = BeautifulSoup(html, 'html.parser')
|
||||||
|
|
||||||
|
assert soup.th.text == 'hello'
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def mock_log(mocker):
|
def mock_log(mocker):
|
||||||
return mocker.patch('logging.log')
|
return mocker.patch('logging.log')
|
||||||
|
|||||||
Reference in New Issue
Block a user