Beispiel #1
0
def test__setup_cats__many_cats(mocker):
    mocker.patch.object(cats, "get_cat_name", side_effect=["Jess", "Larry",
                                                           "Sue"])
    mocker.patch.object(cats, "get_food", side_effect=["berries", "milk",
                                                       "soda"])
    result_cats = cats.setup_cats(3)
    assert result_cats == [
        cats.Cat("Jess", "berries"),
        cats.Cat("Larry", "milk"),
        cats.Cat("Sue", "soda")
    ]
Beispiel #2
0
def test__setup_cats__no_cats():
    result_cats = cats.setup_cats(0)
    assert result_cats == []
Beispiel #3
0
def test__setup_cats__one_cat(mocker):
    mocker.patch.object(cats, "get_cat_name", return_value="Aslan")
    mocker.patch.object(cats, "get_food", return_value="lamb")

    result_cats = cats.setup_cats(1)
    assert result_cats == [cats.Cat("Aslan", "lamb")]