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

Function NewMockConfig

internal/config/test.go:18–20  ·  view source on GitHub ↗

NewMockConfig returns a mock config populated with gh's default config file. See NewMockConfigFromString for when to prefer a mock over NewIsolatedTestConfig.

()

Source from the content-addressed store, hash-verified

16// NewMockConfig returns a mock config populated with gh's default config file.
17// See NewMockConfigFromString for when to prefer a mock over NewIsolatedTestConfig.
18func NewMockConfig() *ghmock.ConfigMock {
19 return NewMockConfigFromString(defaultConfigStr)
20}
21
22// NewMockConfigFromString returns a mock config populated from cfgString, for tests
23// that need to stub config behaviour by assigning to the mock's function fields.

Callers 15

TestSSOURLFunction · 0.92
TestNewGitClientFunction · 0.92
TestNewCmdTokenFunction · 0.92
setupMockOAuthConfigFunction · 0.92
TestNewCmdAgentTaskFunction · 0.92
TestRunLink_RepoFunction · 0.92
TestRunLink_TeamFunction · 0.92
TestRunUnlink_RepoFunction · 0.92
TestRunUnlink_TeamFunction · 0.92
Test_deleteRunFunction · 0.92
Test_listRunFunction · 0.92

Calls 1

NewMockConfigFromStringFunction · 0.85

Tested by 15

TestSSOURLFunction · 0.74
TestNewGitClientFunction · 0.74
TestNewCmdTokenFunction · 0.74
setupMockOAuthConfigFunction · 0.74
TestNewCmdAgentTaskFunction · 0.74
TestRunLink_RepoFunction · 0.74
TestRunLink_TeamFunction · 0.74
TestRunUnlink_RepoFunction · 0.74
TestRunUnlink_TeamFunction · 0.74
Test_deleteRunFunction · 0.74
Test_listRunFunction · 0.74