-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
mock_artifact.go
103 lines (83 loc) · 2.31 KB
/
mock_artifact.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Code generated by mockery v1.0.0. DO NOT EDIT.
package artifact
import (
context "context"
mock "github.com/stretchr/testify/mock"
types "github.com/aquasecurity/trivy/pkg/fanal/types"
)
// MockArtifact is an autogenerated mock type for the Artifact type
type MockArtifact struct {
mock.Mock
}
type ArtifactCleanArgs struct {
Reference types.ArtifactReference
ReferenceAnything bool
}
type ArtifactCleanReturns struct {
_a0 error
}
type ArtifactCleanExpectation struct {
Args ArtifactCleanArgs
Returns ArtifactCleanReturns
}
func (_m *MockArtifact) ApplyCleanExpectation(e ArtifactCleanExpectation) {
var args []interface{}
if e.Args.ReferenceAnything {
args = append(args, mock.Anything)
} else {
args = append(args, e.Args.Reference)
}
_m.On("Clean", args...).Return(e.Returns._a0)
}
func (_m *MockArtifact) ApplyCleanExpectations(expectations []ArtifactCleanExpectation) {
for _, e := range expectations {
_m.ApplyCleanExpectation(e)
}
}
// Clean provides a mock function with given fields: reference
func (_m *MockArtifact) Clean(reference types.ArtifactReference) error {
return nil
}
type ArtifactInspectArgs struct {
Ctx context.Context
CtxAnything bool
}
type ArtifactInspectReturns struct {
Reference types.ArtifactReference
Err error
}
type ArtifactInspectExpectation struct {
Args ArtifactInspectArgs
Returns ArtifactInspectReturns
}
func (_m *MockArtifact) ApplyInspectExpectation(e ArtifactInspectExpectation) {
var args []interface{}
if e.Args.CtxAnything {
args = append(args, mock.Anything)
} else {
args = append(args, e.Args.Ctx)
}
_m.On("Inspect", args...).Return(e.Returns.Reference, e.Returns.Err)
}
func (_m *MockArtifact) ApplyInspectExpectations(expectations []ArtifactInspectExpectation) {
for _, e := range expectations {
_m.ApplyInspectExpectation(e)
}
}
// Inspect provides a mock function with given fields: ctx
func (_m *MockArtifact) Inspect(ctx context.Context) (types.ArtifactReference, error) {
ret := _m.Called(ctx)
var r0 types.ArtifactReference
if rf, ok := ret.Get(0).(func(context.Context) types.ArtifactReference); ok {
r0 = rf(ctx)
} else {
r0 = ret.Get(0).(types.ArtifactReference)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}