def test_with_all(self): """date1 time1 - date2 time2""" actual = format_event_time(self.with_all) expected = f"{self.fmt_start_date} {self.fmt_start_time} - {self.fmt_end_date} {self.fmt_end_time}" self.assertEqual(actual, expected)
def test_same_date(self): """time1 - time2""" actual = format_event_time(self.same_date) expected = "" self.assertEqual(actual, expected)
def test_without_end_date(self): """time1 - time2""" actual = format_event_time(self.without_end_date) expected = f"{self.fmt_start_time} - {self.fmt_end_time}" self.assertEqual(actual, expected)
def test_with_end_time(self): """Ends at time""" actual = format_event_time(self.with_end_time) expected = f"Ends at {self.fmt_end_time}" self.assertEqual(actual, expected)
def test_with_start_time(self): """time""" actual = format_event_time(self.with_start_time) expected = self.fmt_start_time self.assertEqual(actual, expected)
def test_only_start_date(self): """Ignore since events are grouped by date to begin with""" actual = format_event_time(self.only_start_date) expected = "" self.assertIs(actual, expected)
def test_same_date_with_times(self): """time1 - time2""" actual = format_event_time(self.same_date_with_times) expected = f"{self.fmt_start_time} - {self.fmt_end_time}" self.assertEqual(actual, expected)