aboutsummaryrefslogtreecommitdiff
path: root/pkg/navitia_api_client/departures_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/navitia_api_client/departures_test.go')
-rw-r--r--pkg/navitia_api_client/departures_test.go14
1 files changed, 7 insertions, 7 deletions
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)
}