예제 #1
0
def test_not_positive_goal_exception():
    with pytest.raises(ValueError):
        get_number_books_read(0)
    with pytest.raises(ValueError):
        get_number_books_read(-1)
예제 #2
0
def test_past_date_exception():
    with pytest.raises(ValueError):
        get_number_books_read(52, '5-20-2018')
예제 #3
0
def test_get_number_books_read(goal, date_str, expected):
    assert get_number_books_read(goal, date_str) == expected