diff options
author | Julien Dessaux | 2021-09-07 17:32:47 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-09-07 17:32:47 +0200 |
commit | cf7f851a5f47bab8a979135c834dae9ead63a042 (patch) | |
tree | dc88a7650ae4ae769afcd3ac35d3b10680a08d84 /pkg/navitia_api_client/train_stops_test.go | |
parent | Added navitia code to fetch train stops names (diff) | |
download | trains-cf7f851a5f47bab8a979135c834dae9ead63a042.tar.gz trains-cf7f851a5f47bab8a979135c834dae9ead63a042.tar.bz2 trains-cf7f851a5f47bab8a979135c834dae9ead63a042.zip |
Added logic to fetch train stops data if missing when starting the webserver
Diffstat (limited to '')
-rw-r--r-- | pkg/navitia_api_client/train_stops_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/navitia_api_client/train_stops_test.go b/pkg/navitia_api_client/train_stops_test.go index 93fc43f..9e1c982 100644 --- a/pkg/navitia_api_client/train_stops_test.go +++ b/pkg/navitia_api_client/train_stops_test.go @@ -76,7 +76,8 @@ func TestGetTrainStops(t *testing.T) { if err != nil { t.Fatalf("could not get train stops : %s", err) } - if len(trainStops) != 4 { + // 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)) } // normal request in multiple pages @@ -90,7 +91,8 @@ func TestGetTrainStops(t *testing.T) { if err != nil { t.Fatalf("could not get train stops : %+v", err) } - if len(trainStops) != 12 { + // 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)) } // failing request in multiple pages with last one missing |