示例#1
0
def test_range():
    afk = AFKChecker(['2017-01-02 2017-01-04'])

    assert afk.get_afk_end(date(2017, 1, 1)) is None
    assert afk.get_afk_end(date(2017, 1, 2)) == date(2017, 1, 4)
    assert afk.get_afk_end(date(2017, 1, 3)) == date(2017, 1, 4)
    assert afk.get_afk_end(date(2017, 1, 4)) == date(2017, 1, 4)
    assert afk.get_afk_end(date(2017, 1, 5)) is None
示例#2
0
    def test_range(self) -> None:
        afk = AFKChecker(['2017-01-02 2017-01-04'])

        self.assertEqual(afk.get_afk_end(date(2017, 1, 1)), None)
        self.assertEqual(afk.get_afk_end(date(2017, 1, 2)), date(2017, 1, 4))
        self.assertEqual(afk.get_afk_end(date(2017, 1, 3)), date(2017, 1, 4))
        self.assertEqual(afk.get_afk_end(date(2017, 1, 4)), date(2017, 1, 4))
        self.assertEqual(afk.get_afk_end(date(2017, 1, 5)), None)
示例#3
0
    def test_multi(self) -> None:
        afk = AFKChecker(['2017-01-02', '2017-01-04 2017-01-05'])

        self.assertEqual(afk.get_afk_end(date(2017, 1, 1)), None)
        self.assertEqual(afk.get_afk_end(date(2017, 1, 2)), date(2017, 1, 2))
        self.assertEqual(afk.get_afk_end(date(2017, 1, 3)), None)
        self.assertEqual(afk.get_afk_end(date(2017, 1, 4)), date(2017, 1, 5))
        self.assertEqual(afk.get_afk_end(date(2017, 1, 5)), date(2017, 1, 5))
        self.assertEqual(afk.get_afk_end(date(2017, 1, 6)), None)
示例#4
0
def test_multi():
    afk = AFKChecker(['2017-01-02', '2017-01-04 2017-01-05'])

    assert afk.get_afk_end(date(2017, 1, 1)) is None
    assert afk.get_afk_end(date(2017, 1, 2)) == date(2017, 1, 2)
    assert afk.get_afk_end(date(2017, 1, 3)) is None
    assert afk.get_afk_end(date(2017, 1, 4)) == date(2017, 1, 5)
    assert afk.get_afk_end(date(2017, 1, 5)) == date(2017, 1, 5)
    assert afk.get_afk_end(date(2017, 1, 6)) is None
示例#5
0
    def test_empty(self) -> None:
        afk = AFKChecker()

        self.assertEqual(afk.get_afk_end(), None)
        self.assertEqual(afk.get_afk_end(date(2017, 1, 1)), None)
示例#6
0
def test_day():
    afk = AFKChecker(['2017-01-02'])

    assert afk.get_afk_end(date(2017, 1, 1)) is None
    assert afk.get_afk_end(date(2017, 1, 2)) == date(2017, 1, 2)
    assert afk.get_afk_end(date(2017, 1, 3)) is None
示例#7
0
def test_empty():
    afk = AFKChecker()

    assert afk.get_afk_end() is None
    assert afk.get_afk_end(date(2017, 1, 1)) is None
示例#8
0
    def test_day(self):
        afk = AFKChecker(['2017-01-02'])

        self.assertEqual(afk.get_afk_end(date(2017, 1, 1)), None)
        self.assertEqual(afk.get_afk_end(date(2017, 1, 2)), date(2017, 1, 2))
        self.assertEqual(afk.get_afk_end(date(2017, 1, 3)), None)