示例#1
0
def test_search_stations_returns_just_rail_stationsn(mock_http_get):
    mock_http_get.return_value = StringIO("[]")
    search_stations('LIV')
    expected_url = ('http://ojp.nationalrail.co.uk/find/stations/LIV')
    assert_equal(
        mock.call(expected_url),
        mock_http_get.call_args_list[0])
示例#2
0
def test_decode_search_results(mock_http_get):
    with sample_data('01_station_search_results.json') as f:
        mock_http_get.return_value =f
        stations = search_stations('LIV')
        assert_equal(9, len(stations))