Skip to content

Commit

Permalink
chore: Add new test for datetime comparisons.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjw committed Jun 3, 2024
1 parent fc78e9a commit 3c53e2e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,19 @@ def test_date_leap_year(self):
self.assertEqual(2, d.month)
self.assertEqual(29, d.day)
self.assertEqual(3, d.weekday())

def test_datetime_eq(self):
d1 = DateTime(2024, 1, 1, 0, 10, 23, 45)
d2 = DateTime(2024, 1, 1, 0, 10, 23, 45)
d3 = DateTime(2024, 1, 1, 0, 10, 23, 46)

self.assertTrue(d1 == d2)
self.assertFalse(d1 == d3)

def test_datetime_neq(self):
d1 = DateTime(2024, 1, 1, 0, 10, 23, 45)
d2 = DateTime(2024, 1, 1, 0, 10, 23, 45)
d3 = DateTime(2024, 1, 1, 0, 10, 23, 46)

self.assertFalse(d1 != d2)
self.assertTrue(d1 != d3)

0 comments on commit 3c53e2e

Please sign in to comment.