summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrsiddharth <rsd@gnu.org>2016-03-15 23:31:16 -0400
committerrsiddharth <rsd@gnu.org>2016-03-15 23:31:16 -0400
commit7f6af7acf2bdeb216ed6db847d98eeaf13326010 (patch)
treea1c4b3f0d96c2c57fde4ce27f16764f9105e18ab /tests
parentd17f9e74e4d409fb9f07cfd38c956d6b9af7f43c (diff)
Add LPiCal class
Contains two methods at the moment: - get_timeslot - get_month_day Addresses issue #8.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_lps_gen.py61
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/test_lps_gen.py b/tests/test_lps_gen.py
index 852b338..9cc9406 100644
--- a/tests/test_lps_gen.py
+++ b/tests/test_lps_gen.py
@@ -110,6 +110,67 @@ class TestJSONUtils(object):
os.chdir(self.old_cwd)
+class TestLPiCal(object):
+ """
+ Testing LPiCal class.
+ """
+
+ @classmethod
+ def setup_class(self):
+ """Setting up things for Testing LPiCal class.
+ """
+ self.lp_ical = LPiCal({})
+
+
+ def test_get_timeslot(self):
+ """
+ Testing LPiCal.get_timeslot.
+ """
+
+ timeslots = {
+ '09:00-09:45: Registration and Breakfast': ['09:00', '09:45'],
+ ' 09:45 - 10:45: Opening Keynote': ['09:45', '10:45'],
+ '10:5 - 10:55: Break': ['10:5', '10:55'],
+ ' 10:55 - 11:40: Session Block 1A': ['10:55', '11:40'],
+ ' 11:40 - 11:50: Break': ['11:40', '11:50'],
+ '9:45 - 10:30: Keynote ': ['9:45', '10:30'],
+ '16:55 - 17:40:Session Block 6B': ['16:55', '17:40'],
+ '17:50 - 18:35: Closing keynote': ['17:50', '18:35'],
+ }
+
+ for string, timeslot in timeslots.iteritems():
+ start, end = self.lp_ical.get_timeslot(string)
+ assert_equal(start, timeslot[0])
+ assert_equal(end, timeslot[1])
+
+
+ def test_get_month_day(self):
+ """Testing LPiCal.get_month_day.
+ """
+
+ month_days = {
+ 'Sunday, March 20': ['March', '20'],
+ 'Saturday, March 19': ['March', '19'],
+ 'Monday,March 20 ': ['March', '20'],
+ 'Tuesday,March21': ['March', '21'],
+ ' Wednesday, March 22': ['March', '22'],
+ 'Thursday, March 23 ': ['March', '23'],
+ }
+
+ for string, month_day in month_days.iteritems():
+ month, day = self.lp_ical.get_month_day(string)
+ assert_equal(month, month_day[0])
+ assert_equal(day, month_day[1])
+
+
+ @classmethod
+ def teardown_class(self):
+ """
+ Tearing down the mess created by Testing LPiCal class.
+ """
+ pass
+
+
class TestLPS(object):
"""
Class that tests everything related LP Schedule.