コード例 #1
0
def test_wine_clas_average_rating_called_with():
    new_wine = Wine()
    new_wine.average_rating = MagicMock(return_value=3)
    new_wine.average_rating()
    new_wine.average_rating.assert_called_with()
コード例 #2
0
def test_wine_clas_average_rating_returned_value():
    new_wine = Wine()
    new_wine.average_rating = MagicMock(return_value=3)
    assert new_wine.average_rating() == 3