mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Write some tests, fix imports
This commit is contained in:
parent
85f29e7afa
commit
445ca84834
2 changed files with 25 additions and 4 deletions
|
|
@ -1,5 +1,27 @@
|
|||
import pytz
|
||||
|
||||
from data import schedule
|
||||
from datetime import datetime
|
||||
import unittest
|
||||
|
||||
|
||||
class TestSchedule(unittest.TestCase):
|
||||
pass
|
||||
def test_holiday_has_passed(self):
|
||||
tz = pytz.timezone("Europe/Brussels")
|
||||
before = datetime(2020, 8, 8, tzinfo=tz)
|
||||
during = datetime(2021, 6, 2, tzinfo=tz)
|
||||
after = datetime(2021, 8, 8, tzinfo=tz)
|
||||
|
||||
holiday = schedule.Holiday([1, 6, 2021], [2, 7, 2021])
|
||||
|
||||
self.assertFalse(holiday.has_passed(before))
|
||||
self.assertFalse(holiday.has_passed(during))
|
||||
self.assertTrue(holiday.has_passed(after))
|
||||
|
||||
def test_course_str(self):
|
||||
course = schedule.Course("Test")
|
||||
self.assertEqual(str(course), "Test")
|
||||
|
||||
def test_location_str(self):
|
||||
location = schedule.Location("C", "B", "R")
|
||||
self.assertEqual(str(location), "C B R")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue