From 92c5e1e4d073c82e12e26170379cb5c8d90ab2e8 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Tue, 6 Apr 2021 16:46:05 +0200 Subject: Added trainStop config parameter which was wrongly hardcoded --- pkg/navitia_api_client/departures_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'pkg/navitia_api_client/departures_test.go') diff --git a/pkg/navitia_api_client/departures_test.go b/pkg/navitia_api_client/departures_test.go index 14ffb96..e7d771f 100644 --- a/pkg/navitia_api_client/departures_test.go +++ b/pkg/navitia_api_client/departures_test.go @@ -9,20 +9,20 @@ import ( func TestGetDepartures(t *testing.T) { // invalid characters in token client := NewClient("}") - _, err := client.GetDepartures() + _, err := client.GetDepartures("test") if err == nil { - t.Fatalf("invalid characters in token should raise an error") + t.Fatalf("invalid characters in token should raise an error because the url is invalid") } // unreachable server client = NewClient("https://") - _, err = client.GetDepartures() + _, err = client.GetDepartures("test") if err == nil { t.Fatalf("unreachable server should raise an error") } // invalid json client, ts := newTestClientFromFilename(t, "test_data/invalid.json") defer ts.Close() - _, err = client.GetDepartures() + _, err = client.GetDepartures("test") if err == nil { t.Fatalf("invalid json should raise an error") } @@ -31,14 +31,14 @@ func TestGetDepartures(t *testing.T) { w.WriteHeader(http.StatusNotFound) })) client = newTestClient(ts) - _, err = client.GetDepartures() + _, err = client.GetDepartures("test") if err == nil { t.Fatalf("404 should raise an error") } // normal working request client, ts = newTestClientFromFilename(t, "test_data/normal-crepieux.json") defer ts.Close() - departures, err := client.GetDepartures() + departures, err := client.GetDepartures("test") if err != nil { t.Fatalf("could not get normal-crepieux departures : %s", err) } @@ -47,7 +47,7 @@ func TestGetDepartures(t *testing.T) { } // test the cache (assuming the test takes less than 60 seconds (and it really should) it will be accurate) ts.Close() - departures, err = client.GetDepartures() + departures, err = client.GetDepartures("test") if err != nil { t.Fatalf("could not get normal-crepieux departures : %s", err) } -- cgit v1.2.3