mirror of https://github.com/docker/cli.git
Merge pull request #4488 from thaJeztah/registry_test_cleanups
cli/command/registry: cleanup "search" and "login" tests
This commit is contained in:
commit
53671c2fef
|
@ -2,12 +2,9 @@ package registry
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
|
||||||
"strings"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/docker/cli/cli/command/formatter"
|
"github.com/docker/cli/cli/command/formatter"
|
||||||
"github.com/docker/cli/internal/test"
|
|
||||||
registrytypes "github.com/docker/docker/api/types/registry"
|
registrytypes "github.com/docker/docker/api/types/registry"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
is "gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
|
@ -15,50 +12,67 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSearchContext(t *testing.T) {
|
func TestSearchContext(t *testing.T) {
|
||||||
name := "nginx"
|
|
||||||
starCount := 5000
|
|
||||||
|
|
||||||
var ctx searchContext
|
var ctx searchContext
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
searchCtx searchContext
|
searchCtx searchContext
|
||||||
expValue string
|
expValue string
|
||||||
call func() string
|
call func() string
|
||||||
}{
|
}{
|
||||||
{searchContext{
|
{
|
||||||
s: registrytypes.SearchResult{Name: name},
|
searchCtx: searchContext{
|
||||||
}, name, ctx.Name},
|
s: registrytypes.SearchResult{Name: "nginx"},
|
||||||
{searchContext{
|
},
|
||||||
s: registrytypes.SearchResult{StarCount: starCount},
|
expValue: "nginx",
|
||||||
}, "5000", ctx.StarCount},
|
call: ctx.Name,
|
||||||
{searchContext{
|
},
|
||||||
s: registrytypes.SearchResult{IsOfficial: true},
|
{
|
||||||
}, "[OK]", ctx.IsOfficial},
|
searchCtx: searchContext{
|
||||||
{searchContext{
|
s: registrytypes.SearchResult{StarCount: 5000},
|
||||||
s: registrytypes.SearchResult{IsOfficial: false},
|
},
|
||||||
}, "", ctx.IsOfficial},
|
expValue: "5000",
|
||||||
{searchContext{
|
call: ctx.StarCount,
|
||||||
s: registrytypes.SearchResult{IsAutomated: true}, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
|
},
|
||||||
}, "[OK]", ctx.IsAutomated},
|
{
|
||||||
{searchContext{
|
searchCtx: searchContext{
|
||||||
s: registrytypes.SearchResult{},
|
s: registrytypes.SearchResult{IsOfficial: true},
|
||||||
}, "", ctx.IsAutomated},
|
},
|
||||||
|
expValue: "[OK]",
|
||||||
|
call: ctx.IsOfficial,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
searchCtx: searchContext{
|
||||||
|
s: registrytypes.SearchResult{IsOfficial: false},
|
||||||
|
},
|
||||||
|
call: ctx.IsOfficial,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
searchCtx: searchContext{
|
||||||
|
s: registrytypes.SearchResult{IsAutomated: true}, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
|
||||||
|
},
|
||||||
|
expValue: "[OK]",
|
||||||
|
call: ctx.IsAutomated,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
searchCtx: searchContext{
|
||||||
|
s: registrytypes.SearchResult{},
|
||||||
|
},
|
||||||
|
call: ctx.IsAutomated,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, c := range cases {
|
for _, c := range cases {
|
||||||
ctx = c.searchCtx
|
ctx = c.searchCtx
|
||||||
v := c.call()
|
v := c.call()
|
||||||
if strings.Contains(v, ",") {
|
assert.Check(t, is.Equal(v, c.expValue))
|
||||||
test.CompareMultipleValues(t, v, c.expValue)
|
|
||||||
} else if v != c.expValue {
|
|
||||||
t.Fatalf("Expected %s, was %s\n", c.expValue, v)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSearchContextDescription(t *testing.T) {
|
func TestSearchContextDescription(t *testing.T) {
|
||||||
shortDescription := "Official build of Nginx."
|
const (
|
||||||
longDescription := "Automated Nginx reverse proxy for docker containers"
|
shortDescription = "Official build of Nginx."
|
||||||
descriptionWReturns := "Automated\nNginx reverse\rproxy\rfor docker\ncontainers"
|
longDescription = "Automated Nginx reverse proxy for docker containers"
|
||||||
|
descriptionWReturns = "Automated\nNginx reverse\rproxy\rfor docker\ncontainers"
|
||||||
|
)
|
||||||
|
|
||||||
var ctx searchContext
|
var ctx searchContext
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
|
@ -66,80 +80,118 @@ func TestSearchContextDescription(t *testing.T) {
|
||||||
expValue string
|
expValue string
|
||||||
call func() string
|
call func() string
|
||||||
}{
|
}{
|
||||||
{searchContext{
|
{
|
||||||
s: registrytypes.SearchResult{Description: shortDescription},
|
searchCtx: searchContext{
|
||||||
trunc: true,
|
s: registrytypes.SearchResult{Description: shortDescription},
|
||||||
}, shortDescription, ctx.Description},
|
trunc: true,
|
||||||
{searchContext{
|
},
|
||||||
s: registrytypes.SearchResult{Description: shortDescription},
|
expValue: shortDescription,
|
||||||
trunc: false,
|
call: ctx.Description,
|
||||||
}, shortDescription, ctx.Description},
|
},
|
||||||
{searchContext{
|
{
|
||||||
s: registrytypes.SearchResult{Description: longDescription},
|
searchCtx: searchContext{
|
||||||
trunc: false,
|
s: registrytypes.SearchResult{Description: shortDescription},
|
||||||
}, longDescription, ctx.Description},
|
trunc: false,
|
||||||
{searchContext{
|
},
|
||||||
s: registrytypes.SearchResult{Description: longDescription},
|
expValue: shortDescription,
|
||||||
trunc: true,
|
call: ctx.Description,
|
||||||
}, formatter.Ellipsis(longDescription, 45), ctx.Description},
|
},
|
||||||
{searchContext{
|
{
|
||||||
s: registrytypes.SearchResult{Description: descriptionWReturns},
|
searchCtx: searchContext{
|
||||||
trunc: false,
|
s: registrytypes.SearchResult{Description: longDescription},
|
||||||
}, longDescription, ctx.Description},
|
trunc: false,
|
||||||
{searchContext{
|
},
|
||||||
s: registrytypes.SearchResult{Description: descriptionWReturns},
|
expValue: longDescription,
|
||||||
trunc: true,
|
call: ctx.Description,
|
||||||
}, formatter.Ellipsis(longDescription, 45), ctx.Description},
|
},
|
||||||
|
{
|
||||||
|
searchCtx: searchContext{
|
||||||
|
s: registrytypes.SearchResult{Description: longDescription},
|
||||||
|
trunc: true,
|
||||||
|
},
|
||||||
|
expValue: formatter.Ellipsis(longDescription, 45),
|
||||||
|
call: ctx.Description,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
searchCtx: searchContext{
|
||||||
|
s: registrytypes.SearchResult{Description: descriptionWReturns},
|
||||||
|
trunc: false,
|
||||||
|
},
|
||||||
|
expValue: longDescription,
|
||||||
|
call: ctx.Description,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
searchCtx: searchContext{
|
||||||
|
s: registrytypes.SearchResult{Description: descriptionWReturns},
|
||||||
|
trunc: true,
|
||||||
|
},
|
||||||
|
expValue: formatter.Ellipsis(longDescription, 45),
|
||||||
|
call: ctx.Description,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, c := range cases {
|
for _, c := range cases {
|
||||||
ctx = c.searchCtx
|
ctx = c.searchCtx
|
||||||
v := c.call()
|
v := c.call()
|
||||||
if strings.Contains(v, ",") {
|
assert.Check(t, is.Equal(v, c.expValue))
|
||||||
test.CompareMultipleValues(t, v, c.expValue)
|
|
||||||
} else if v != c.expValue {
|
|
||||||
t.Fatalf("Expected %s, was %s\n", c.expValue, v)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSearchContextWrite(t *testing.T) {
|
func TestSearchContextWrite(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
context formatter.Context
|
doc string
|
||||||
expected string
|
format formatter.Format
|
||||||
|
expected string
|
||||||
|
expectedErr string
|
||||||
}{
|
}{
|
||||||
// Errors
|
|
||||||
{
|
{
|
||||||
formatter.Context{Format: "{{InvalidFunction}}"},
|
doc: "Errors",
|
||||||
`template parsing error: template: :1: function "InvalidFunction" not defined`,
|
format: "{{InvalidFunction}}",
|
||||||
|
expectedErr: `template parsing error: template: :1: function "InvalidFunction" not defined`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
formatter.Context{Format: "{{nil}}"},
|
doc: "Nil format",
|
||||||
`template parsing error: template: :1:2: executing "" at <nil>: nil is not a command`,
|
format: "{{nil}}",
|
||||||
},
|
expectedErr: `template parsing error: template: :1:2: executing "" at <nil>: nil is not a command`,
|
||||||
// Table format
|
|
||||||
{
|
|
||||||
formatter.Context{Format: NewSearchFormat("table")},
|
|
||||||
string(golden.Get(t, "search-context-write-table.golden")),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
formatter.Context{Format: NewSearchFormat("table {{.Name}}")},
|
doc: "JSON format",
|
||||||
`NAME
|
format: "{{json .}}",
|
||||||
|
expected: `{"Description":"Official build","IsAutomated":"false","IsOfficial":"true","Name":"result1","StarCount":"5000"}
|
||||||
|
{"Description":"Not official","IsAutomated":"true","IsOfficial":"false","Name":"result2","StarCount":"5"}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
doc: "JSON format, single field",
|
||||||
|
format: "{{json .Name}}",
|
||||||
|
expected: `"result1"
|
||||||
|
"result2"
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
doc: "Table format",
|
||||||
|
format: NewSearchFormat("table"),
|
||||||
|
expected: string(golden.Get(t, "search-context-write-table.golden")),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
doc: "Table format, single column",
|
||||||
|
format: NewSearchFormat("table {{.Name}}"),
|
||||||
|
expected: `NAME
|
||||||
result1
|
result1
|
||||||
result2
|
result2
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
// Custom Format
|
|
||||||
{
|
{
|
||||||
formatter.Context{Format: NewSearchFormat("{{.Name}}")},
|
doc: "Custom format, single field",
|
||||||
`result1
|
format: NewSearchFormat("{{.Name}}"),
|
||||||
|
expected: `result1
|
||||||
result2
|
result2
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
// Custom Format with CreatedAt
|
|
||||||
{
|
{
|
||||||
formatter.Context{Format: NewSearchFormat("{{.Name}} {{.StarCount}}")},
|
doc: "Custom Format, two columns",
|
||||||
`result1 5000
|
format: NewSearchFormat("{{.Name}} {{.StarCount}}"),
|
||||||
|
expected: `result1 5000
|
||||||
result2 5
|
result2 5
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
@ -152,61 +204,15 @@ result2 5
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
tc := tc
|
tc := tc
|
||||||
t.Run(string(tc.context.Format), func(t *testing.T) {
|
t.Run(tc.doc, func(t *testing.T) {
|
||||||
var out bytes.Buffer
|
var out bytes.Buffer
|
||||||
tc.context.Output = &out
|
err := SearchWrite(formatter.Context{Format: tc.format, Output: &out}, results)
|
||||||
|
if tc.expectedErr != "" {
|
||||||
err := SearchWrite(tc.context, results)
|
assert.Check(t, is.Error(err, tc.expectedErr))
|
||||||
if err != nil {
|
|
||||||
assert.Error(t, err, tc.expected)
|
|
||||||
} else {
|
} else {
|
||||||
assert.Equal(t, out.String(), tc.expected)
|
assert.Check(t, err)
|
||||||
}
|
}
|
||||||
|
assert.Check(t, is.Equal(out.String(), tc.expected))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSearchContextWriteJSON(t *testing.T) {
|
|
||||||
results := []registrytypes.SearchResult{
|
|
||||||
{Name: "result1", Description: "Official build", StarCount: 5000, IsOfficial: true},
|
|
||||||
{Name: "result2", Description: "Not official", StarCount: 5, IsOfficial: false, IsAutomated: true}, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
|
|
||||||
}
|
|
||||||
expectedJSONs := []map[string]interface{}{
|
|
||||||
{"Name": "result1", "Description": "Official build", "StarCount": "5000", "IsOfficial": "true", "IsAutomated": "false"},
|
|
||||||
{"Name": "result2", "Description": "Not official", "StarCount": "5", "IsOfficial": "false", "IsAutomated": "true"},
|
|
||||||
}
|
|
||||||
|
|
||||||
out := bytes.NewBufferString("")
|
|
||||||
err := SearchWrite(formatter.Context{Format: "{{json .}}", Output: out}, results)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
for i, line := range strings.Split(strings.TrimSpace(out.String()), "\n") {
|
|
||||||
t.Logf("Output: line %d: %s", i, line)
|
|
||||||
var m map[string]interface{}
|
|
||||||
if err := json.Unmarshal([]byte(line), &m); err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
assert.Check(t, is.DeepEqual(m, expectedJSONs[i]))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestSearchContextWriteJSONField(t *testing.T) {
|
|
||||||
results := []registrytypes.SearchResult{
|
|
||||||
{Name: "result1", Description: "Official build", StarCount: 5000, IsOfficial: true},
|
|
||||||
{Name: "result2", Description: "Not official", StarCount: 5, IsOfficial: false, IsAutomated: true}, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
|
|
||||||
}
|
|
||||||
out := bytes.NewBufferString("")
|
|
||||||
err := SearchWrite(formatter.Context{Format: "{{json .Name}}", Output: out}, results)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
for i, line := range strings.Split(strings.TrimSpace(out.String()), "\n") {
|
|
||||||
t.Logf("Output: line %d: %s", i, line)
|
|
||||||
var s string
|
|
||||||
if err := json.Unmarshal([]byte(line), &s); err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
assert.Check(t, is.Equal(s, results[i].Name))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -17,15 +17,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
userErr = "userunknownError"
|
unknownUser = "userunknownError"
|
||||||
testAuthErrMsg = "UNKNOWN_ERR"
|
errUnknownUser = "UNKNOWN_ERR"
|
||||||
)
|
|
||||||
|
|
||||||
var testAuthErrors = map[string]error{
|
|
||||||
userErr: fmt.Errorf(testAuthErrMsg),
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
expiredPassword = "I_M_EXPIRED"
|
expiredPassword = "I_M_EXPIRED"
|
||||||
useToken = "I_M_TOKEN"
|
useToken = "I_M_TOKEN"
|
||||||
)
|
)
|
||||||
|
@ -47,8 +40,10 @@ func (c fakeClient) RegistryLogin(_ context.Context, auth registrytypes.AuthConf
|
||||||
IdentityToken: auth.Password,
|
IdentityToken: auth.Password,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
err := testAuthErrors[auth.Username]
|
if auth.Username == unknownUser {
|
||||||
return registrytypes.AuthenticateOKBody{}, err
|
return registrytypes.AuthenticateOKBody{}, fmt.Errorf(errUnknownUser)
|
||||||
|
}
|
||||||
|
return registrytypes.AuthenticateOKBody{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLoginWithCredStoreCreds(t *testing.T) {
|
func TestLoginWithCredStoreCreds(t *testing.T) {
|
||||||
|
@ -63,10 +58,10 @@ func TestLoginWithCredStoreCreds(t *testing.T) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
inputAuthConfig: registrytypes.AuthConfig{
|
inputAuthConfig: registrytypes.AuthConfig{
|
||||||
Username: userErr,
|
Username: unknownUser,
|
||||||
},
|
},
|
||||||
expectedMsg: "Authenticating with existing credentials...\n",
|
expectedMsg: "Authenticating with existing credentials...\n",
|
||||||
expectedErr: fmt.Sprintf("Login did not succeed, error: %s\n", testAuthErrMsg),
|
expectedErr: fmt.Sprintf("Login did not succeed, error: %s\n", errUnknownUser),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
@ -83,10 +78,12 @@ func TestLoginWithCredStoreCreds(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRunLogin(t *testing.T) {
|
func TestRunLogin(t *testing.T) {
|
||||||
const storedServerAddress = "reg1"
|
const (
|
||||||
const validUsername = "u1"
|
storedServerAddress = "reg1"
|
||||||
const validPassword = "p1"
|
validUsername = "u1"
|
||||||
const validPassword2 = "p2"
|
validPassword = "p1"
|
||||||
|
validPassword2 = "p2"
|
||||||
|
)
|
||||||
|
|
||||||
validAuthConfig := configtypes.AuthConfig{
|
validAuthConfig := configtypes.AuthConfig{
|
||||||
ServerAddress: storedServerAddress,
|
ServerAddress: storedServerAddress,
|
||||||
|
@ -104,20 +101,22 @@ func TestRunLogin(t *testing.T) {
|
||||||
IdentityToken: useToken,
|
IdentityToken: useToken,
|
||||||
}
|
}
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
|
doc string
|
||||||
inputLoginOption loginOptions
|
inputLoginOption loginOptions
|
||||||
inputStoredCred *configtypes.AuthConfig
|
inputStoredCred *configtypes.AuthConfig
|
||||||
expectedErr string
|
expectedErr string
|
||||||
expectedSavedCred configtypes.AuthConfig
|
expectedSavedCred configtypes.AuthConfig
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
|
doc: "valid auth from store",
|
||||||
inputLoginOption: loginOptions{
|
inputLoginOption: loginOptions{
|
||||||
serverAddress: storedServerAddress,
|
serverAddress: storedServerAddress,
|
||||||
},
|
},
|
||||||
inputStoredCred: &validAuthConfig,
|
inputStoredCred: &validAuthConfig,
|
||||||
expectedErr: "",
|
|
||||||
expectedSavedCred: validAuthConfig,
|
expectedSavedCred: validAuthConfig,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
doc: "expired auth",
|
||||||
inputLoginOption: loginOptions{
|
inputLoginOption: loginOptions{
|
||||||
serverAddress: storedServerAddress,
|
serverAddress: storedServerAddress,
|
||||||
},
|
},
|
||||||
|
@ -125,13 +124,13 @@ func TestRunLogin(t *testing.T) {
|
||||||
expectedErr: "Error: Cannot perform an interactive login from a non TTY device",
|
expectedErr: "Error: Cannot perform an interactive login from a non TTY device",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
doc: "valid username and password",
|
||||||
inputLoginOption: loginOptions{
|
inputLoginOption: loginOptions{
|
||||||
serverAddress: storedServerAddress,
|
serverAddress: storedServerAddress,
|
||||||
user: validUsername,
|
user: validUsername,
|
||||||
password: validPassword2,
|
password: validPassword2,
|
||||||
},
|
},
|
||||||
inputStoredCred: &validAuthConfig,
|
inputStoredCred: &validAuthConfig,
|
||||||
expectedErr: "",
|
|
||||||
expectedSavedCred: configtypes.AuthConfig{
|
expectedSavedCred: configtypes.AuthConfig{
|
||||||
ServerAddress: storedServerAddress,
|
ServerAddress: storedServerAddress,
|
||||||
Username: validUsername,
|
Username: validUsername,
|
||||||
|
@ -139,27 +138,29 @@ func TestRunLogin(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
doc: "unknown user",
|
||||||
inputLoginOption: loginOptions{
|
inputLoginOption: loginOptions{
|
||||||
serverAddress: storedServerAddress,
|
serverAddress: storedServerAddress,
|
||||||
user: userErr,
|
user: unknownUser,
|
||||||
password: validPassword,
|
password: validPassword,
|
||||||
},
|
},
|
||||||
inputStoredCred: &validAuthConfig,
|
inputStoredCred: &validAuthConfig,
|
||||||
expectedErr: testAuthErrMsg,
|
expectedErr: errUnknownUser,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
doc: "valid token",
|
||||||
inputLoginOption: loginOptions{
|
inputLoginOption: loginOptions{
|
||||||
serverAddress: storedServerAddress,
|
serverAddress: storedServerAddress,
|
||||||
user: validUsername,
|
user: validUsername,
|
||||||
password: useToken,
|
password: useToken,
|
||||||
},
|
},
|
||||||
inputStoredCred: &validIdentityToken,
|
inputStoredCred: &validIdentityToken,
|
||||||
expectedErr: "",
|
|
||||||
expectedSavedCred: validIdentityToken,
|
expectedSavedCred: validIdentityToken,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for i, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
|
tc := tc
|
||||||
|
t.Run(tc.doc, func(t *testing.T) {
|
||||||
tmpFile := fs.NewFile(t, "test-run-login")
|
tmpFile := fs.NewFile(t, "test-run-login")
|
||||||
defer tmpFile.Remove()
|
defer tmpFile.Remove()
|
||||||
cli := test.NewFakeCli(&fakeClient{})
|
cli := test.NewFakeCli(&fakeClient{})
|
||||||
|
|
Loading…
Reference in New Issue