def test_owner_move_attempted_if_cat_not_found(mocker): mocker.patch('herdcats.players._is_cat_found').return_value = False mocker.patch( 'herdcats.players._attempt_cat_move' ) move_owner = mocker.patch( 'herdcats.players._attempt_owner_move' ) owner_and_cat = 'owner_and_cat' players._attempt_move(owner_and_cat) move_owner.assert_called_once_with(owner_and_cat)
def test_cat_doesnt_move_if_cat_already_found(mocker): mocker.patch('herdcats.players._is_cat_found').return_value = True owner_and_cat = { 'cat': [1, 2] } moved = players._attempt_move(owner_and_cat) assert moved is owner_and_cat