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

Function Test_printAuthWarnings

internal/ghcmd/cmd_test.go:712–723  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

710}
711
712func Test_printAuthWarnings(t *testing.T) {
713 ios, _, _, _ := iostreams.Test()
714 authCfg := warningsAuthConfig{
715 AuthConfig: config.NewMockConfig().Authentication(),
716 warnings: []string{"first line\nsecond line", "another warning"},
717 }
718
719 var out bytes.Buffer
720 printAuthWarnings(&out, ios.ColorScheme(), authCfg)
721
722 assert.Equal(t, "! first line\n second line\n! another warning\n", out.String())
723}

Callers

nothing calls this directly

Calls 7

TestFunction · 0.92
NewMockConfigFunction · 0.92
printAuthWarningsFunction · 0.85
ColorSchemeMethod · 0.80
EqualMethod · 0.80
AuthenticationMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected