diff options
author | rsiddharth <rsd@gnu.org> | 2019-07-13 19:27:18 -0400 |
---|---|---|
committer | rsiddharth <rsd@gnu.org> | 2019-07-13 19:27:18 -0400 |
commit | 73ccb20703f86d968cbcf617eb0eafa3e89c6b92 (patch) | |
tree | 2a35c08ef1a7c41e6878c9562ddbad817491d5ec /tests | |
parent | b202aa341ff1427c668985754e5f87e76aab8591 (diff) |
lps_gen: Remove `lp_t` command line argument.
* docs/install/index.rst: Update usage command output.
* docs/schedule/index.rst: Update lps_gen command example.
* docs/speakers/index.rst: Update lps_gen command example.
* lps_gen.py (RenderHTML): Change argument template ->
template_name. Read template from package.
(main): Remove `lp_t` command line argument.
* tests/test_lps_gen.py (TestLPS.test_RenderHTML)
(TestLPS.test_RenderHTML_sessions_only)
(TestLPS.test_RenderHTML_nonexistent_template)
(TestLPSTBA.setup, TestLPSpeakers.test_RenderHTML): Update RenderHTML
call; pass template name instead of template path.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_lps_gen.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/test_lps_gen.py b/tests/test_lps_gen.py index 81a3ab6..9551e18 100644 --- a/tests/test_lps_gen.py +++ b/tests/test_lps_gen.py @@ -557,7 +557,7 @@ class TestLPS(object): def test_RenderHTML(self): """Testing `RenderHTML` function with LP schedule """ - lps_html = RenderHTML(self.lps_dict, self.SCH_TEMPLATE) + lps_html = RenderHTML(self.lps_dict, 'schedule') print(lps_html) # TODO: Scrape and test html output @@ -568,19 +568,15 @@ class TestLPS(object): 'lp-sch-sessions-only.md')) lps_html = RenderHTML(self.markdown(md_content), - self.SCH_TEMPLATE) + 'schedule') print(lps_html) # TODO: Scrape and test html output @raises(SystemExit) def test_RenderHTML_nonexistent_template(self): """Testing `RenderHTML` function - LP schedule - ith non-existent template """ - with mock.patch('sys.stdout', new_callable=StringIO) as out: - nonexistent_template = 'lpsch-template.null' - - lps_html = RenderHTML(self.lps_dict, nonexistent_template) - expected_out = 'Template %s not found.\n' % template_name - assert out.getvalue() == expected_out + with mock.patch('sys.stderr', new_callable=StringIO) as out: + lps_html = RenderHTML(self.lps_dict, 'nonexistent') def teardown(self): @@ -628,7 +624,7 @@ class TestLPSTBA(object): """Runs before each test in this class. """ - lp_html = RenderHTML(self.lps_dict, self.SCH_TEMPLATE) + lp_html = RenderHTML(self.lps_dict, 'schedule') self.soup = BeautifulSoup(lp_html, 'html.parser') @@ -969,7 +965,7 @@ class TestLPSpeakers(object): def test_RenderHTML(self): """Testing `RenderHTML` function with LP speakers """ - lps_html = RenderHTML(self.lpspeakers_dict, self.SPEAKERS_TEMPLATE) + lps_html = RenderHTML(self.lpspeakers_dict, 'speakers') print(lps_html) # TODO: Scrape and test html output. |