MCPcopy Create free account
hub / github.com/cli/cli / TestGetOrDefaultNonExistentKey

Function TestGetOrDefaultNonExistentKey

internal/config/config_test.go:69–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

67}
68
69func TestGetOrDefaultNonExistentKey(t *testing.T) {
70 // Given we have no top level configuration
71 cfg := newTestConfig()
72
73 // When we get a key that has no value
74 optionalEntry := cfg.GetOrDefault("", "non-existent-key")
75
76 // Then it returns a None variant
77 require.True(t, optionalEntry.IsNone(), "expected there to be no value")
78}
79
80func TestGetOrDefaultNonExistentHostSpecificKey(t *testing.T) {
81 // Given have no top level configuration

Callers

nothing calls this directly

Calls 3

newTestConfigFunction · 0.85
IsNoneMethod · 0.80
GetOrDefaultMethod · 0.65

Tested by

no test coverage detected