Esempio n. 1
0
def test_each_cat_found_this_turn_is_handled(mocker):
    mocker.patch('herdcats.players._attempt_move')
    mocker.patch(
        'herdcats.players._is_cat_found_this_turn'
    ).side_effect = [True, False, True]
    handle = mocker.patch('herdcats.players._handle_found_cat')
    owner_and_cats = 'abc'
    turn = 1

    players.move(owner_and_cats, turn)

    assert handle.call_args_list == [
        (('a', 0),),
        (('c', 2),),
    ]
Esempio n. 2
0
def test_each_owner_and_cat_attempt_to_move_each_turn(mocker):
    mocker.patch('herdcats.players._is_cat_found_this_turn')
    mocker.patch('herdcats.players._get_current_stations')
    mocker.patch('herdcats.players._print_found_cat')
    mocker.patch('herdcats.tube.close_station')
    move = mocker.patch('herdcats.players._attempt_move')
    owner_and_cats = 'abc'
    turn = 1

    players.move(owner_and_cats, turn)

    assert move.call_args_list == [
        (('a',),),
        (('b',),),
        (('c',),),
    ]