mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-01 09:28:30 +02:00
Fix test
This commit is contained in:
@ -56,26 +56,29 @@ func TestCreateRepoObjectFormat(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
loginAddCmd := &cli.Command{
|
||||
loginCmd := &cli.Command{
|
||||
Name: "login",
|
||||
Commands: []*cli.Command{
|
||||
&login.CmdLoginAdd,
|
||||
&login.CmdLoginList,
|
||||
},
|
||||
}
|
||||
giteaUserName := os.Getenv("GITEA_TEA_TEST_USERNAME")
|
||||
giteaUserPasword := os.Getenv("GITEA_TEA_TEST_PASSWORD")
|
||||
args := []string{"login", "add", "--name", "test-login", "--url", giteaURL, "--user", giteaUserName, "--password", giteaUserPasword}
|
||||
err := loginAddCmd.Run(context.Background(), args)
|
||||
args := []string{"login", "add", "--name", "test", "--url", giteaURL, "--user", giteaUserName, "--password", giteaUserPasword}
|
||||
err := loginCmd.Run(context.Background(), args)
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = loginCmd.Run(context.Background(), []string{"login", "list"})
|
||||
assert.NoError(t, err)
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
reposCmd := &cli.Command{
|
||||
Name: "repos",
|
||||
|
||||
Name: "repos",
|
||||
Commands: []*cli.Command{&CmdRepoCreate},
|
||||
}
|
||||
tt.args = append(tt.args, "--login", "test-login")
|
||||
tt.args = append(tt.args, "--login", "test")
|
||||
args := append([]string{"repos", "create"}, tt.args...)
|
||||
|
||||
err := reposCmd.Run(context.Background(), args)
|
||||
|
Reference in New Issue
Block a user