mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 17:47:46 +01:00
update ut mock anything (#19506)
Signed-off-by: yminer <yminer@vmware.com>
This commit is contained in:
parent
7c83e3a4a5
commit
6d817724e6
@ -29,8 +29,8 @@ import (
|
||||
|
||||
func Test_projectReferenceObject(t *testing.T) {
|
||||
ctl := &project.Controller{}
|
||||
ctl.On("GetByName", mock.Anything, "library").Return(&proModels.Project{ProjectID: 1}, nil)
|
||||
ctl.On("GetByName", mock.Anything, "demo").Return(nil, fmt.Errorf("not found"))
|
||||
ctl.On("GetByName", mock.AnythingOfType("context.todoCtx"), "library").Return(&proModels.Project{ProjectID: 1}, nil)
|
||||
ctl.On("GetByName", mock.AnythingOfType("context.todoCtx"), "demo").Return(nil, fmt.Errorf("not found"))
|
||||
|
||||
originalProjectController := projectController
|
||||
defer func() {
|
||||
|
Loading…
Reference in New Issue
Block a user