From 73ccb20703f86d968cbcf617eb0eafa3e89c6b92 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 13 Jul 2019 19:27:18 -0400 Subject: 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. --- tests/test_lps_gen.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'tests/test_lps_gen.py') 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. -- cgit v1.2.3