mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-05 19:32:53 +02:00
Fix lint
This commit is contained in:
@ -4,13 +4,14 @@
|
||||
package repos
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/urfave/cli/v2"
|
||||
"github.com/urfave/cli/v3"
|
||||
)
|
||||
|
||||
func TestCreateRepoObjectFormat(t *testing.T) {
|
||||
@ -50,16 +51,14 @@ func TestCreateRepoObjectFormat(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
app := cli.NewApp()
|
||||
reposCmd := &cli.Command{
|
||||
Name: "repos",
|
||||
Aliases: []string{"repo"},
|
||||
Subcommands: []*cli.Command{&CmdRepoCreate},
|
||||
Name: "repos",
|
||||
Aliases: []string{"repo"},
|
||||
Commands: []*cli.Command{&CmdRepoCreate},
|
||||
}
|
||||
app.Commands = []*cli.Command{reposCmd}
|
||||
args := append([]string{"tea", "repos", "create"}, tt.args...)
|
||||
|
||||
err := app.Run(args)
|
||||
err := reposCmd.Run(context.Background(), args)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
if tt.errContains != "" {
|
||||
@ -69,8 +68,6 @@ func TestCreateRepoObjectFormat(t *testing.T) {
|
||||
}
|
||||
|
||||
assert.NoError(t, err)
|
||||
// Note: We can't directly test the CreateRepoOption since it's created inside runRepoCreate
|
||||
// In a real test environment, we would mock the client and verify the options passed to it
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user