Exemplo n.º 1
0
def test_get_result_timeout_None_return():
    expected = 'this_does_not_matter',
    re = get_result(None, expected, 'so_does_this')
    assert re == 'Timeout'
Exemplo n.º 2
0
def test_get_result_incorrect_zero_return(tmpdir):
    p = tmpdir.join('expected')
    p.write('1\n4')
    got = '1\n2'
    re = get_result(0, str(p), got)
    assert re == 'Incorrect'
Exemplo n.º 3
0
def test_get_result_error_non_zero_return():
    expected = 'this_does_not_matter'
    re = get_result(1, expected, 'so_does_this')
    assert re == 'Error'
Exemplo n.º 4
0
def test_get_result_catchall():
    re = get_result(tuple(), 'a', 'b')
    assert re == 'Contact a volunteer'
    assert isinstance(re, str)