def test_invalid_day(self): self.assertRaises(ValueError, lambda: Day(0)) self.assertRaises(ValueError, lambda: Day(32))
def test_eq(self): self.assertEqual(Day(1), Day(1))
def test_is_first(self): self.assertTrue(Day(1).is_first()) self.assertFalse(Day(2).is_first())
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)))
def test_ge(self): self.assertGreaterEqual(Day(2), Day(1)) self.assertGreaterEqual(Day(2), Day(2))
def test_gt(self): self.assertGreater(Day(2), Day(1))
def test_le(self): self.assertLessEqual(Day(1), Day(2)) self.assertLessEqual(Day(2), Day(2))
def test_lt(self): self.assertLess(Day(1), Day(2))
def test_ne(self): self.assertNotEqual(Day(1), Day(2))