unittest description

Add test messages for Event.__str__ tests.
pull/30/head
dlichtistw 2018-10-02 22:09:57 +02:00
rodzic 001885677c
commit dff4e359f7
1 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -155,12 +155,12 @@ class ICalEventsTests(unittest.TestCase):
evs = icalevents.events(file=ical, start=start, end=end)
e1 = evs[0]
self.assertIsNotNone(search(r"ended", str(e1.copy_to(n - relativedelta(days=5) + m))))
self.assertIsNotNone(search(r"today", str(e1.copy_to(n - relativedelta(days=1) + m))))
self.assertIsNotNone(search(r"days left", str(e1.copy_to(n + relativedelta(days=3) + m))))
self.assertIsNotNone(search(r"ended", str(e1.copy_to(n - relativedelta(days=5) + m))), "stringify past event")
self.assertIsNotNone(search(r"today", str(e1.copy_to(n - relativedelta(days=1) + m))), "stringify ongoing event")
self.assertIsNotNone(search(r"days left", str(e1.copy_to(n + relativedelta(days=3) + m))), "stringify future event")
e2 = evs[1]
self.assertIsNotNone(search(r"ended", str(e2.copy_to(n - relativedelta(hours=5)))))
self.assertIsNotNone(search(r"now", str(e2.copy_to(n - relativedelta(hours=1)))))
self.assertIsNotNone(search(r"hours left", str(e2.copy_to(n + relativedelta(hours=3)))))
self.assertIsNotNone(search(r"days left", str(e2.copy_to(n + relativedelta(days=3)))))
self.assertIsNotNone(search(r"ended", str(e2.copy_to(n - relativedelta(hours=5)))), "stringify past event")
self.assertIsNotNone(search(r"now", str(e2.copy_to(n - relativedelta(hours=1)))), "stringify ongoing event")
self.assertIsNotNone(search(r"hours left", str(e2.copy_to(n + relativedelta(hours=3)))), "stringify future event")
self.assertIsNotNone(search(r"days left", str(e2.copy_to(n + relativedelta(days=3)))), "stringify future event")