Пример #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