Esempio n. 1
0
def test_time_rule_reverse():
    time_rule = rules.TimeRule(start_time=datetime.time(13, 0, 0),
                               end_time=datetime.time(9, 0, 0))

    assert time_rule.test_user() is False
Esempio n. 2
0
def test_time_rule_reverse_next_day():
    time_rule = rules.TimeRule(start_time=datetime.time(11, 0, 0),
                               end_time=datetime.time(11, 0, 0))

    assert time_rule.test_user() is False
Esempio n. 3
0
def test_create_time_rule():
    time_rule = rules.TimeRule(start_time=datetime.time(8, 0, 0),
                               end_time=datetime.time(23, 0, 0))

    assert time_rule.test_user() is True