diff options
author | Julien Dessaux | 2021-09-10 17:26:23 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-09-10 17:26:23 +0200 |
commit | 678fdf8759a7a6ed6628194d085a47b5490e68ea (patch) | |
tree | a335a5db442ad8ba2cc780c5ca17250a68d4f8f1 /pkg/navitia_api_client/stops_test.go | |
parent | Added database function to get all train stops (diff) | |
download | trains-678fdf8759a7a6ed6628194d085a47b5490e68ea.tar.gz trains-678fdf8759a7a6ed6628194d085a47b5490e68ea.tar.bz2 trains-678fdf8759a7a6ed6628194d085a47b5490e68ea.zip |
Finished not so simple refactoring
Diffstat (limited to 'pkg/navitia_api_client/stops_test.go')
-rw-r--r-- | pkg/navitia_api_client/stops_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/navitia_api_client/stops_test.go b/pkg/navitia_api_client/stops_test.go index 0b94765..c3a91f2 100644 --- a/pkg/navitia_api_client/stops_test.go +++ b/pkg/navitia_api_client/stops_test.go @@ -72,13 +72,13 @@ func TestGetStops(t *testing.T) { // normal working request client, ts = newTestClientFromFilename(t, "test_data/4-train-stops.json") defer ts.Close() - trainStops, err := client.GetStops() + stops, err := client.GetStops() if err != nil { t.Fatalf("could not get train stops : %s", err) } // 4 records but one is empty (navitia api quirk) - if len(trainStops) != 3 { - t.Fatalf("did not decode train stops properly, got %d train stops when expected 4", len(trainStops)) + if len(stops) != 3 { + t.Fatalf("did not decode train stops properly, got %d train stops when expected 4", len(stops)) } // normal request in multiple pages client, ts = newTestClientFromFilenames(t, []testClientCase{ @@ -87,13 +87,13 @@ func TestGetStops(t *testing.T) { testClientCase{"/coverage/sncf/stop_areas?count=1000&start_page=2", "test_data/4-train-stops-page-2.json"}, }) defer ts.Close() - trainStops, err = client.GetStops() + stops, err = client.GetStops() if err != nil { t.Fatalf("could not get train stops : %+v", err) } // 12 records but one is empty (navitia api quirk) - if len(trainStops) != 11 { - t.Fatalf("did not decode train stops properly, got %d train stops when expected 4", len(trainStops)) + if len(stops) != 11 { + t.Fatalf("did not decode train stops properly, got %d train stops when expected 4", len(stops)) } // failing request in multiple pages with last one missing client, ts = newTestClientFromFilenames(t, []testClientCase{ @@ -101,8 +101,8 @@ func TestGetStops(t *testing.T) { testClientCase{"/coverage/sncf/stop_areas?count=1000&start_page=1", "test_data/4-train-stops-page-1.json"}, }) defer ts.Close() - trainStops, err = client.GetStops() + stops, err = client.GetStops() if err == nil { - t.Fatalf("should not be able to get train stops : %+v", trainStops) + t.Fatalf("should not be able to get train stops : %+v", stops) } } |