MCPcopy Index your code
hub / github.com/cli/cli / TestGetOrDefaultNonExistentHostSpecificKey

Function TestGetOrDefaultNonExistentHostSpecificKey

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

Source from the content-addressed store, hash-verified

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