コード例 #1
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_at_characters_in_string():
    with pytest.raises(ding.InvalidArguments) as excinfo:
        x = ding.check_input(['at', '22a:71'])
コード例 #2
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_time_a_second_in_the_past():
    a_second_ago = datetime.datetime.now() - datetime.timedelta(seconds=1)
    time_str = str(a_second_ago.time()).split('.')[0]
    assert ding.check_input(['at', time_str])
コード例 #3
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_at_invalid_hour():
    with pytest.raises(ding.InvalidArguments) as excinfo:
        x = ding.check_input(['at', '25'])
コード例 #4
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_at_invalid_minute():
    with pytest.raises(ding.InvalidArguments) as excinfo:
        x = ding.check_input(['at', '22:71'])
コード例 #5
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_in_partly_wrong_suffix():
    with pytest.raises(ding.InvalidArguments) as excinfo:
        x = ding.check_input(['in', '1s', '1x'])
コード例 #6
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_at_invalid_separator():
    with pytest.raises(ding.InvalidArguments) as excinfo:
        x = ding.check_input(['in', '15', '30'])
コード例 #7
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_insufficient_arguments_at():
    with pytest.raises(ding.InvalidArguments) as excinfo:
        x = ding.check_input(['at'])
コード例 #8
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_no_arguments():
    with pytest.raises(ding.InvalidArguments) as excinfo:
        x = ding.check_input([])
コード例 #9
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_time_in_1h_1m_1s():
    assert ding.check_input(['in', '1h', '1m', '1s'])
コード例 #10
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_time_in_1m():
    assert ding.check_input(['in', '1h'])
コード例 #11
0
ファイル: test_arguments.py プロジェクト: Tav0/ding
def test_time_a_minute_in_the_future():
    a_second_ago = datetime.datetime.now() + datetime.timedelta(minutes=1)
    time_str = str(a_second_ago.time()).split('.')[0]
    assert ding.check_input(['at', time_str])