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/config/config_test.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'pkg/config/config_test.go') diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 6969191..a4c170b 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -11,16 +11,18 @@ import ( func TestLoadFile(t *testing.T) { // Minimal yaml file minimalConfig := Config{ - Address: "127.0.0.2", - Port: "8082", - Token: "12345678-9abc-def0-1234-56789abcdef0", + Address: "127.0.0.2", + Port: "8082", + Token: "12345678-9abc-def0-1234-56789abcdef0", + TrainStop: "ABCD:test:01", } // Minimal yaml file with hostname resolving minimalConfigWithResolving := Config{ - Address: "localhost", - Port: "www", - Token: "12345678-9abc-def0-1234-56789abcdef0", + Address: "localhost", + Port: "www", + Token: "12345678-9abc-def0-1234-56789abcdef0", + TrainStop: "VWXY_Z:test:90", } // Test cases @@ -36,6 +38,7 @@ func TestLoadFile(t *testing.T) { {"Unresolvable address should fail to load", "test_data/invalid_address_unresolvable.yaml", nil, &InvalidAddressError{}}, {"Invalid port should fail to load", "test_data/invalid_port.yaml", nil, &InvalidPortError{}}, {"Invalid token should fail to load", "test_data/invalid_token.yaml", nil, &InvalidTokenError{}}, + {"Invalid trainStop should fail to load", "test_data/invalid_trainStop.yaml", nil, &InvalidTrainStopError{}}, {"Minimal config", "test_data/minimal.yaml", &minimalConfig, nil}, {"Minimal config with resolving", "test_data/minimal_with_hostname.yaml", &minimalConfigWithResolving, nil}, } -- cgit v1.2.3