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

Function TestDefaultHostFromEnvVar

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

Source from the content-addressed store, hash-verified

197}
198
199func TestDefaultHostFromEnvVar(t *testing.T) {
200 // Given the GH_HOST env var is set
201 authCfg := newTestAuthConfig(t)
202 t.Setenv("GH_HOST", "ghe.io")
203
204 // When we get the DefaultHost
205 defaultHost, source := authCfg.DefaultHost()
206
207 // Then the returned host and source are using the env var
208 require.Equal(t, "ghe.io", defaultHost)
209 require.Equal(t, "GH_HOST", source)
210}
211
212func TestDefaultHostNotLoggedIn(t *testing.T) {
213 // 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