diff options
author | rsiddharth <rsd@gnu.org> | 2016-01-28 08:39:17 -0500 |
---|---|---|
committer | rsiddharth <rsd@gnu.org> | 2016-01-28 08:39:17 -0500 |
commit | 77aa5dad923f4efad2e271ca3f38a7585ab2680b (patch) | |
tree | dac4286016de8bc5a3a53cc546aa3b2feadca300 /tests/test_lps_gen.py | |
parent | 7ca74c9b9470b8773358f22b011136e5579237f6 (diff) |
lps_gen accepts template as arg.
As per Zak's request, the script now requires the user to pass the
template as (the first) argument to the script.
The script does not use the template that is part of the
lpschedule-generator module; indeed the internal template will be
deleted later.
Diffstat (limited to 'tests/test_lps_gen.py')
-rw-r--r-- | tests/test_lps_gen.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/test_lps_gen.py b/tests/test_lps_gen.py index e964a5a..a84ca78 100644 --- a/tests/test_lps_gen.py +++ b/tests/test_lps_gen.py @@ -42,6 +42,9 @@ class TestLpsGen(object): self.MD_FILE = path.join('tests', 'files', 'lp-sch.md') self.MD_FILE_CONTENT = read_file(self.MD_FILE) + self.SCH_TEMPLATE = path.join('tests', 'files', + 'lp-sch-2016.jinja2') + self.markdown = LPSMarkdown() self.lps_dict = self.markdown(self.MD_FILE_CONTENT) @@ -160,19 +163,18 @@ class TestLpsGen(object): def test_RenderHTML(self): """Testing `RenderHTML` function """ - lps_html = RenderHTML(self.lps_dict, '2016') + lps_html = RenderHTML(self.lps_dict, self.SCH_TEMPLATE) print lps_html @raises(SystemExit) def test_RenderHTML_invalid_year(self): - """Testing `RenderHTML` function - with invalid year + """Testing `RenderHTML` function - with non-existent template """ with mock.patch('sys.stdout', new_callable=StringIO) as out: - invalid_year = '2016_invalid' - template_name = 'lp-sch-%s.jinja2' % invalid_year + nonexistent_template = 'lpsch-template.null' - lps_html = RenderHTML(self.lps_dict, invalid_year) + lps_html = RenderHTML(self.lps_dict, nonexistent_template) expected_out = 'Template %s not found.\n' % template_name assert out.getvalue() == expected_out |