Testing pretty print produces good html

Signed-off-by: Mike Terzo <mike@terzo.org>
This commit is contained in:
Mike Terzo
2017-01-23 06:31:02 -05:00
parent 0d1fbcee88
commit 0570372d97

View File

@@ -14,7 +14,7 @@ from puppetboard import utils
from puppetboard import app
from puppetboard.app import NoContent
from bs4 import BeautifulSoup
import logging
@@ -54,6 +54,15 @@ def test_get():
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
def mock_log(mocker):
return mocker.patch('logging.log')