예제 #1
0
def test_at_parse_regex_match(line, expected):
    result = remind.REGEX_AT.match(line)
    assert result

    reminder = remind.parse_regex_match(result, 'UTC')
    assert reminder == expected
    assert reminder.get_duration() >= 0
예제 #2
0
def test_at_parse_regex_match_invalid_duration(line, expected):
    result = remind.REGEX_AT.match(line)
    assert result

    reminder = remind.parse_regex_match(result, 'UTC')
    assert reminder == expected

    with pytest.raises(ValueError):
        reminder.get_duration()