Ejemplo n.º 1
0
    def test_is_on_offset(self):
        tests = [
            (self._offset(), datetime(2008, 1, 1), True),
            (self._offset(), datetime(2008, 1, 5), False),
        ]

        for offset, d, expected in tests:
            assert_is_on_offset(offset, d, expected)
Ejemplo n.º 2
0
    def test_is_on_offset(self, weekday):
        offset = Week(weekday=weekday)

        for day in range(1, 8):
            date = datetime(2008, 1, day)

            if day % 7 == weekday:
                expected = True
            else:
                expected = False
        assert_is_on_offset(offset, date, expected)
Ejemplo n.º 3
0
 def test_is_on_offset(self, case):
     dt, expected = case
     assert_is_on_offset(SemiMonthBegin(), dt, expected)
Ejemplo n.º 4
0
 def test_is_on_offset(self, case):
     offset, dt, expected = case
     assert_is_on_offset(offset, dt, expected)