gui/pkg/container/mode_test.go
Snider 32c4a66ae2
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Implement RFC integration gaps
2026-04-15 14:48:12 +01:00

24 lines
528 B
Go

package container
import "testing"
func TestDetectModeWithEnvironment(t *testing.T) {
mode := DetectModeWithEnvironment(ModeEnvironment{
Args: []string{"--mode=worker"},
})
if mode != ModeWorker {
t.Fatalf("expected worker mode, got %q", mode)
}
mode = DetectModeWithEnvironment(ModeEnvironment{
LookupEnv: func(key string) (string, bool) {
if key == "CORE_GUI_MODE" {
return "manager", true
}
return "", false
},
})
if mode != ModeManager {
t.Fatalf("expected manager mode, got %q", mode)
}
}