Example #1
0
 def test_invalid_day(self):
     self.assertRaises(ValueError, lambda: Day(0))
     self.assertRaises(ValueError, lambda: Day(32))
Example #2
0
 def test_eq(self):
     self.assertEqual(Day(1), Day(1))
Example #3
0
 def test_is_first(self):
     self.assertTrue(Day(1).is_first())
     self.assertFalse(Day(2).is_first())
Example #4
0
 def test_is_last(self):
     self.assertFalse(Day(1).is_last())
     self.assertTrue(Day(31).is_last())
     self.assertTrue(Day(28).is_last(month=Month(2)))
     self.assertTrue(Day(29).is_last(month=Month(2), year=Year(2020)))
Example #5
0
 def test_ge(self):
     self.assertGreaterEqual(Day(2), Day(1))
     self.assertGreaterEqual(Day(2), Day(2))
Example #6
0
 def test_gt(self):
     self.assertGreater(Day(2), Day(1))
Example #7
0
 def test_le(self):
     self.assertLessEqual(Day(1), Day(2))
     self.assertLessEqual(Day(2), Day(2))
Example #8
0
 def test_lt(self):
     self.assertLess(Day(1), Day(2))
Example #9
0
 def test_ne(self):
     self.assertNotEqual(Day(1), Day(2))