Exemplo n.º 1
0
def test_cat_reported_when_found(mocker):
    report = mocker.patch('herdcats.players._print_found_cat')
    mocker.patch(
        'herdcats.players._get_current_stations'
    ).return_value = ('station',)
    mocker.patch('herdcats.tube.close_station')
    owner_id = 1

    players._handle_found_cat('cat', owner_id)

    report.assert_called_once_with(owner_id, 'station')
Exemplo n.º 2
0
def test_station_is_closed_when_cat_found(mocker):
    mocker.patch('herdcats.players._print_found_cat')
    get_current_stations = mocker.patch(
        'herdcats.players._get_current_stations')
    get_current_stations.return_value = ('station',)
    close_station = mocker.patch('herdcats.tube.close_station')

    players._handle_found_cat('cat', 1)

    get_current_stations.assert_called_once_with('cat')
    close_station.assert_called_once_with('station')