From 4ff3775934fc3c5087a364ffa53f02ec8240e944 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 6 May 2026 17:18:27 -0700 Subject: [PATCH] fix --- cmd/pulls/reply_test.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cmd/pulls/reply_test.go b/cmd/pulls/reply_test.go index 2e8ccb2..ac34815 100644 --- a/cmd/pulls/reply_test.go +++ b/cmd/pulls/reply_test.go @@ -7,10 +7,25 @@ import ( "context" "testing" + "code.gitea.io/tea/modules/config" + "github.com/stretchr/testify/assert" ) func TestReply(t *testing.T) { + config.SetConfigForTesting(config.LocalConfig{ + Logins: []config.Login{{ + Name: "testLogin", + URL: "https://gitea.example.com", + Token: "test-token", + User: "testUser", + Default: true, + }}, + }) + t.Cleanup(func() { + config.SetConfigForTesting(config.LocalConfig{}) + }) + tests := []struct { name string args []string @@ -41,7 +56,7 @@ func TestReply(t *testing.T) { t.Run(tt.name, func(t *testing.T) { cmd := CmdPullsReply args := append([]string{"reply"}, tt.args...) - args = append(args, "--repo", "user/repo") + args = append(args, "--login", "testLogin", "--repo", "user/repo") err := cmd.Run(context.Background(), args) if tt.wantErr { assert.Error(t, err)