mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
refactor: remove helpers the new output and prompts left unused
Drop writeDownload, terminal.Require, terminal.Confirm, terminal.Row, terminal.Record and Pulls.FindOpenByHead, which no command calls anymore, and point their tests at the code that replaced them. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
8 files changed
+34
-118
No files matched your search
@@ -57,7 +57,7 @@ func TestPullMilestoneClearUsesIssueEndpoint(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFindOpenByHeadPagesPastSmallServerLimitsAndMatchesExactly(t *testing.T) {
|
||||
func TestListOpenPagesPastSmallServerLimits(t *testing.T) {
|
||||
client := newTestClient(t, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
assert.Equal(t, "/api/v1/repos/alice/project/pulls", r.URL.Path)
|
||||
switch r.URL.Query().Get("page") {
|
||||
@@ -70,11 +70,10 @@ func TestFindOpenByHeadPagesPastSmallServerLimitsAndMatchesExactly(t *testing.T)
|
||||
}
|
||||
}))
|
||||
service := Pulls{Client: client, Repository: "alice/project"}
|
||||
item, err := service.FindOpenByHead(context.Background(), "feature")
|
||||
items, err := service.ListOpen(context.Background())
|
||||
require.NoError(t, err)
|
||||
require.EqualValues(t, 2, item.Number)
|
||||
_, err = service.FindOpenByHead(context.Background(), "FEATURE")
|
||||
require.ErrorContains(t, err, "no open pull request")
|
||||
require.Len(t, items, 2)
|
||||
require.Equal(t, "feature", items[1].Head)
|
||||
}
|
||||
|
||||
func TestListOpenRejectsEndlessPagination(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user