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

Function TestGetOrDefaultNonExistentHostSpecificKey

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

Source from the content-addressed store, hash-verified

78}
79
80func TestGetOrDefaultNonExistentHostSpecificKey(t *testing.T) {
81 // Given have no top level configuration
82 cfg := newTestConfig()
83
84 // When we get a key for a host that has no value
85 optionalEntry := cfg.GetOrDefault("non-existent-host", "non-existent-key")
86
87 // Then it returns a None variant
88 require.True(t, optionalEntry.IsNone(), "expected there to be no value")
89}
90
91func TestGetOrDefaultExistingTopLevelKey(t *testing.T) {
92 // Given have a top level config entry

Callers

nothing calls this directly

Calls 3

newTestConfigFunction · 0.85
IsNoneMethod · 0.80
GetOrDefaultMethod · 0.65

Tested by

no test coverage detected