summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrsiddharth <rsd@gnu.org>2016-02-13 13:40:23 -0500
committerrsiddharth <rsd@gnu.org>2016-02-13 13:40:23 -0500
commit8a818223805e74f64772e06926e3ae87be141e80 (patch)
tree8cb86d6b919ebc5a791c4f3fadd7e024adb93afd /tests
parent227a9ee87dcb4269580bc1a1c2880792e877a68d (diff)
LPSpeakersMarkdown writes speakers.ids to disk.
The `speaker.ids` file contains a mapping of the speakers and their corresponding ids. This file will later be used by LPSMarkdown and LPSRenderer to auto link speakers while generating the sessions page. Addresses issue #7
Diffstat (limited to 'tests')
-rw-r--r--tests/test_lps_gen.py26
1 files changed, 23 insertions, 3 deletions
diff --git a/tests/test_lps_gen.py b/tests/test_lps_gen.py
index 00b21ef..f4f64b5 100644
--- a/tests/test_lps_gen.py
+++ b/tests/test_lps_gen.py
@@ -288,10 +288,14 @@ class TestLPSpeakers(object):
def setup_class(self):
"""Runs before running any tests in this class."""
- self.MD_FILE = path.join('tests', 'files', 'lp-speakers.md')
+ # Change current working directory to the tests directory.
+ self.old_cwd = os.getcwd()
+ os.chdir('tests')
+
+ self.MD_FILE = path.join('files', 'lp-speakers.md')
self.MD_FILE_CONTENT = read_file(self.MD_FILE)
- self.SPEAKERS_TEMPLATE = path.join('tests', 'files',
+ self.SPEAKERS_TEMPLATE = path.join('files',
'lp-speakers-2016.jinja2')
self.markdown = LPSpeakersMarkdown()
@@ -303,6 +307,16 @@ class TestLPSpeakers(object):
pass
+ def test_speakers_id_file_exists(self):
+ """
+ Testing if LPSpeakersMardown created speakers.ids file.
+ """
+ speakers_ids = self.markdown.speakers_renderer.speakers_ids
+
+ assert path.isfile('speakers.ids')
+ assert_equal(json_read('speakers.ids'), speakers_ids)
+
+
def test_LPSpeakersMarkdown_keynotespeakers_name(self):
"""Testing LPSpeakersMarkdown keynote speakers' names.
@@ -528,4 +542,10 @@ class TestLPSpeakers(object):
@classmethod
def teardown_class(self):
"""Purge the mess created by this test."""
- pass
+
+ # Remove `speakers.ids` file if it exists.
+ if path.isfile('speakers.ids'):
+ os.remove('speakers.ids')
+
+ # Change back to the old cwd
+ os.chdir(self.old_cwd)