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