diff options
author | Julien Dessaux | 2021-09-09 21:54:49 +0200 |
---|---|---|
committer | Julien Dessaux | 2021-09-09 21:54:49 +0200 |
commit | bd0cd129be3b9a15cecc5394e899341f0479d115 (patch) | |
tree | 749fff97f14af0dc1eec7353af96bd3a1abfa5f9 | |
parent | Added database function to get a train stop name from its id (diff) | |
download | trains-bd0cd129be3b9a15cecc5394e899341f0479d115.tar.gz trains-bd0cd129be3b9a15cecc5394e899341f0479d115.tar.bz2 trains-bd0cd129be3b9a15cecc5394e899341f0479d115.zip |
Simple variable refactoring
-rw-r--r-- | pkg/database/stop_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/database/stop_test.go b/pkg/database/stop_test.go index d3db75e..2922cbe 100644 --- a/pkg/database/stop_test.go +++ b/pkg/database/stop_test.go @@ -11,7 +11,7 @@ import ( ) func TestCountStops(t *testing.T) { - trainStops := []model.Stop{ + stops := []model.Stop{ model.Stop{Id: "id1", Name: "name1"}, model.Stop{Id: "id2", Name: "name2"}, } @@ -25,14 +25,14 @@ func TestCountStops(t *testing.T) { // normal check err = db.Migrate() require.NoError(t, err) - err = db.ReplaceAndImportStops(trainStops) + err = db.ReplaceAndImportStops(stops) i, err = db.CountStops() require.NoError(t, err) - assert.Equal(t, i, len(trainStops)) + assert.Equal(t, i, len(stops)) } func TestGetStop(t *testing.T) { - trainStops := []model.Stop{ + stops := []model.Stop{ model.Stop{Id: "id1", Name: "name1"}, model.Stop{Id: "id2", Name: "name2"}, } @@ -41,11 +41,11 @@ func TestGetStop(t *testing.T) { require.NoError(t, err) err = db.Migrate() require.NoError(t, err) - err = db.ReplaceAndImportStops(trainStops) + err = db.ReplaceAndImportStops(stops) // normal check stop, err := db.GetStop("id1") require.NoError(t, err) - assert.Equal(t, stop, &trainStops[0]) + assert.Equal(t, stop, &stops[0]) // error check stop, err = db.GetStop("non_existent") require.Error(t, err) |