mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-02-13 21:00:00 +00:00
Migrate to mockery v3 (#5547)
This commit is contained in:
@@ -65,7 +65,7 @@ func TestPipelineList(t *testing.T) {
|
||||
|
||||
for _, tt := range testtases {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
mockClient := mocks.NewClient(t)
|
||||
mockClient := mocks.NewMockClient(t)
|
||||
mockClient.On("PipelineList", mock.Anything, mock.Anything).Return(func(_ int64, opt woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error) {
|
||||
if tt.pipelineErr != nil {
|
||||
return nil, tt.pipelineErr
|
||||
|
||||
@@ -76,7 +76,7 @@ func TestPipelinePurge(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
mockClient := mocks.NewClient(t)
|
||||
mockClient := mocks.NewMockClient(t)
|
||||
mockClient.On("RepoLookup", mock.Anything).Maybe().Return(&woodpecker.Repo{ID: tt.repoID}, nil)
|
||||
|
||||
mockClient.On("PipelineList", mock.Anything, mock.Anything).Return(func(_ int64, opt woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error) {
|
||||
|
||||
@@ -48,7 +48,7 @@ func TestRepoShow(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
mockClient := mocks.NewClient(t)
|
||||
mockClient := mocks.NewMockClient(t)
|
||||
mockClient.On("Repo", tt.repoID).Return(tt.mockRepo, tt.mockError).Maybe()
|
||||
mockClient.On("RepoLookup", "owner/repo").Return(tt.mockRepo, nil).Maybe()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user