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

Function TestDefaultHostFromEnvVar

internal/config/auth_config_test.go:215–226  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

213}
214
215func TestDefaultHostFromEnvVar(t *testing.T) {
216 // Given the GH_HOST env var is set
217 authCfg := newTestAuthConfig(t)
218 t.Setenv("GH_HOST", "ghe.io")
219
220 // When we get the DefaultHost
221 defaultHost, source := authCfg.DefaultHost()
222
223 // Then the returned host and source are using the env var
224 require.Equal(t, "ghe.io", defaultHost)
225 require.Equal(t, "GH_HOST", source)
226}
227
228func TestDefaultHostNotLoggedIn(t *testing.T) {
229 // Given we are not logged in

Callers

nothing calls this directly

Calls 3

newTestAuthConfigFunction · 0.85
EqualMethod · 0.80
DefaultHostMethod · 0.65

Tested by

no test coverage detected