diff options
Diffstat (limited to 'tests/test_lps_gen.py')
-rw-r--r-- | tests/test_lps_gen.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_lps_gen.py b/tests/test_lps_gen.py index cab3fa8..8473955 100644 --- a/tests/test_lps_gen.py +++ b/tests/test_lps_gen.py @@ -22,8 +22,10 @@ import json import pprint import mistune +import mock from os import path +from StringIO import StringIO from nose.tools import * @@ -161,6 +163,18 @@ class TestLpsGen(object): print lps_html + def test_RenderHTML_invalid_year(self): + """Testing `RenderHTML` function - with invalid year + """ + with mock.patch('sys.stdout', new_callable=StringIO) as out: + invalid_year = '2016_invalid' + template_name = 'lp-sch-%s.jinja2' % invalid_year + + lps_html = RenderHTML(self.lps_dict, invalid_year) + expected_out = 'Template %s not found.\n' % template_name + assert out.getvalue() == expected_out + + def teardown(self): """Cleans up things after each test in this class.""" pass |