aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/config/config_test.go')
-rw-r--r--pkg/config/config_test.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go
index a4c170b..af18fc1 100644
--- a/pkg/config/config_test.go
+++ b/pkg/config/config_test.go
@@ -11,8 +11,8 @@ import (
func TestLoadFile(t *testing.T) {
// Minimal yaml file
minimalConfig := Config{
- Address: "127.0.0.2",
- Port: "8082",
+ Address: "127.0.0.1",
+ Port: "8080",
Token: "12345678-9abc-def0-1234-56789abcdef0",
TrainStop: "ABCD:test:01",
}
@@ -25,6 +25,14 @@ func TestLoadFile(t *testing.T) {
TrainStop: "VWXY_Z:test:90",
}
+ // Complete yaml file
+ completeConfig := Config{
+ Address: "127.0.0.2",
+ Port: "8082",
+ Token: "12345678-9abc-def0-1234-56789abcdef0",
+ TrainStop: "ABCD:test:01",
+ }
+
// Test cases
testCases := []struct {
name string
@@ -41,6 +49,7 @@ func TestLoadFile(t *testing.T) {
{"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},
+ {"Complete config", "test_data/complete.yaml", &completeConfig, nil},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {