Ejemplo n.º 1
0
 def test_two_high_fivers(self):
     test_date = datetime.datetime(year=2010, month=2, day=10, hour=2, minute=50)
     event = events.HighFiveEvent(test_date, "Kate", "John")
     output = main.render_hourly()
     test_date = datetime.datetime(year=2010, month=2, day=10, hour=2, minute=55)
     event = events.HighFiveEvent(test_date, "Lewis", "John")
     output = main.render_hourly()
     self.assertEqual(output.strip(), "2am:\t2 people high fived 1 person")
Ejemplo n.º 2
0
 def test_multiple_enters_one_person(self):
     test_date = datetime.datetime(year=2010, month=2, day=10, hour=2, minute=50)
     event = events.EnterEvent(test_date, "Kate")
     test_date = datetime.datetime(year=2010, month=2, day=10, hour=2, minute=55)
     event = events.EnterEvent(test_date, "Kate")
     output = main.render_hourly()
     self.assertEqual(output.strip(), "2am:\t1 person entered")
Ejemplo n.º 3
0
 def test_one_leave_one_later_comment(self):
     test_date = datetime.datetime(year=2010, month=2, day=10, hour=2, minute=59)
     event = events.LeaveEvent(test_date, "Kate")
     test_date = datetime.datetime(year=2010, month=2, day=10, hour=3, minute=59)
     event = events.CommentEvent(test_date, "Kate", "was here")
     output = main.render_hourly()
     self.assertEqual(output.strip(), "2am:\t1 person left\n\t\n3am:\t1 comment")
Ejemplo n.º 4
0
 def test_one_enter(self):
     test_date = datetime.datetime(year=2010, month=2, day=10, hour=23, minute=59)
     event = events.EnterEvent(test_date, "Kate")
     output = main.render_hourly()
     self.assertEqual(output.strip(), "11pm:\t1 person entered")
Ejemplo n.º 5
0
 def test_no_events(self):
     output = main.render_hourly()
     self.assertEqual(output, "")