aboutsummaryrefslogtreecommitdiff
path: root/navitia_api_client/departures_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'navitia_api_client/departures_test.go')
-rw-r--r--navitia_api_client/departures_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/navitia_api_client/departures_test.go b/navitia_api_client/departures_test.go
index 2c87429..a1658d2 100644
--- a/navitia_api_client/departures_test.go
+++ b/navitia_api_client/departures_test.go
@@ -45,4 +45,13 @@ func TestGetDepartures(t *testing.T) {
if len(departures.Departures) != 10 {
t.Fatalf("did not decode normal-crepieux departures properly, got %d departures when expected 10", len(departures.Departures))
}
+ // 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()
+ if err != nil {
+ t.Fatalf("could not get normal-crepieux departures : %s", err)
+ }
+ if len(departures.Departures) != 10 {
+ t.Fatalf("did not decode normal-crepieux departures properly, got %d departures when expected 10", len(departures.Departures))
+ }
}