예제 #1
0
def test_years_ago_wrong_input():
    with pytest.raises(ValueError):
        # Sept != valid %b value 'Sep'
        assert years_ago('6 Sept, 2014') == 4
예제 #2
0
def test_years_ago():
    assert years_ago('8 Aug, 2015') == 3
    assert years_ago('6 Sep, 2014') == 4
    assert years_ago('1 Oct, 2010') == 8
    assert years_ago('31 Dec, 1958') == 60
예제 #3
0
def test_years_ago():
    assert years_ago("8 Aug, 2015") == 3
    assert years_ago("6 Sep, 2014") == 4
    assert years_ago("1 Oct, 2010") == 8
    assert years_ago("31 Dec, 1958") == 60