MCPcopy Create free account
hub / github.com/openclaw/gogcli / TestDefaultRuntimeSnapshotsKeyringOptions

Function TestDefaultRuntimeSnapshotsKeyringOptions

internal/cmd/runtime_test.go:43–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

41)
42
43func TestDefaultRuntimeSnapshotsKeyringOptions(t *testing.T) {
44 t.Setenv("GOG_KEYRING_BACKEND", "file")
45 t.Setenv("GOG_KEYRING_PASSWORD", "")
46 t.Setenv("GOG_KEYRING_SERVICE_NAME", "snapshot")
47 t.Setenv("GOG_KEYRING_LOCK_TIMEOUT", "250ms")
48 t.Setenv("DBUS_SESSION_BUS_ADDRESS", "unix:path=/snapshot")
49
50 runtime := newDefaultRuntime()
51 t.Setenv("GOG_KEYRING_BACKEND", "keychain")
52 t.Setenv("GOG_KEYRING_SERVICE_NAME", "changed")
53
54 options := runtime.KeyringOptions
55 if options == nil {
56 t.Fatal("expected keyring options")
57 }
58 if options.Backend != "file" || options.ServiceName != "snapshot" {
59 t.Fatalf("options = %#v", options)
60 }
61 if options.Password != "" || !options.PasswordSet {
62 t.Fatalf("empty password presence was not captured: %#v", options)
63 }
64 if options.GOOS != goruntime.GOOS || options.DBusAddress != "unix:path=/snapshot" {
65 t.Fatalf("platform options = %#v", options)
66 }
67 if options.LockTimeout != 250*time.Millisecond {
68 t.Fatalf("lock timeout = %v", options.LockTimeout)
69 }
70}
71
72func TestNormalizedRuntimeRequiresKeyringOptions(t *testing.T) {
73 t.Parallel()

Callers

nothing calls this directly

Calls 1

newDefaultRuntimeFunction · 0.85

Tested by

no test coverage detected