Files
Gardomatic/cmd/web/config_test.go
T
kleiax 904d14b64c
CI / test (push) Canceled after 0s
Initial commit
2026-09-12 22:22:17 +02:00

17 lines
442 B
Go

package main
import "testing"
func TestConfigFromEnvironment(t *testing.T) {
t.Setenv("GARDOMATIC_WEB_HOST", "0.0.0.0")
t.Setenv("GARDOMATIC_WEB_PORT", "4444")
t.Setenv("GARDOMATIC_API_BASE_URL", "https://api.example.com")
cfg, err := configFromEnvironment()
if err != nil {
t.Fatal(err)
}
if cfg.Host != "0.0.0.0" || cfg.Port != 4444 || cfg.APIBaseURL != "https://api.example.com" {
t.Fatalf("unexpected config: %#v", cfg)
}
}