27 lines
514 B
Go
27 lines
514 B
Go
package config
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestLoadReadsRequestTimeout(t *testing.T) {
|
|
t.Setenv("REQUEST_TIMEOUT_MS", "1200")
|
|
|
|
cfg := Load()
|
|
|
|
if cfg.RequestTimeout != 1200*time.Millisecond {
|
|
t.Fatalf("RequestTimeout = %s, want 1.2s", cfg.RequestTimeout)
|
|
}
|
|
}
|
|
|
|
func TestLoadReadsPlatformRelease(t *testing.T) {
|
|
t.Setenv("PLATFORM_RELEASE", "platform-20260704153005")
|
|
|
|
cfg := Load()
|
|
|
|
if cfg.PlatformRelease != "platform-20260704153005" {
|
|
t.Fatalf("PlatformRelease = %q", cfg.PlatformRelease)
|
|
}
|
|
}
|