/
Cache.go
111 lines (85 loc) · 2.96 KB
/
Cache.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
104
105
106
107
108
109
110
111
// Code generated by mockery v2.13.1. DO NOT EDIT.
package mocks
import (
agglog "github.com/kevin-hanselman/dud/src/agglog"
artifact "github.com/kevin-hanselman/dud/src/artifact"
mock "github.com/stretchr/testify/mock"
pb "github.com/cheggaaa/pb/v3"
strategy "github.com/kevin-hanselman/dud/src/strategy"
)
// Cache is an autogenerated mock type for the Cache type
type Cache struct {
mock.Mock
}
// Checkout provides a mock function with given fields: workDir, art, s, p
func (_m *Cache) Checkout(workDir string, art artifact.Artifact, s strategy.CheckoutStrategy, p *pb.ProgressBar) error {
ret := _m.Called(workDir, art, s, p)
var r0 error
if rf, ok := ret.Get(0).(func(string, artifact.Artifact, strategy.CheckoutStrategy, *pb.ProgressBar) error); ok {
r0 = rf(workDir, art, s, p)
} else {
r0 = ret.Error(0)
}
return r0
}
// Commit provides a mock function with given fields: workDir, art, s, l
func (_m *Cache) Commit(workDir string, art *artifact.Artifact, s strategy.CheckoutStrategy, l *agglog.AggLogger) error {
ret := _m.Called(workDir, art, s, l)
var r0 error
if rf, ok := ret.Get(0).(func(string, *artifact.Artifact, strategy.CheckoutStrategy, *agglog.AggLogger) error); ok {
r0 = rf(workDir, art, s, l)
} else {
r0 = ret.Error(0)
}
return r0
}
// Fetch provides a mock function with given fields: remoteSrc, arts
func (_m *Cache) Fetch(remoteSrc string, arts map[string]*artifact.Artifact) error {
ret := _m.Called(remoteSrc, arts)
var r0 error
if rf, ok := ret.Get(0).(func(string, map[string]*artifact.Artifact) error); ok {
r0 = rf(remoteSrc, arts)
} else {
r0 = ret.Error(0)
}
return r0
}
// Push provides a mock function with given fields: remoteDst, arts
func (_m *Cache) Push(remoteDst string, arts map[string]*artifact.Artifact) error {
ret := _m.Called(remoteDst, arts)
var r0 error
if rf, ok := ret.Get(0).(func(string, map[string]*artifact.Artifact) error); ok {
r0 = rf(remoteDst, arts)
} else {
r0 = ret.Error(0)
}
return r0
}
// Status provides a mock function with given fields: workDir, art, shortCircuit
func (_m *Cache) Status(workDir string, art artifact.Artifact, shortCircuit bool) (artifact.Status, error) {
ret := _m.Called(workDir, art, shortCircuit)
var r0 artifact.Status
if rf, ok := ret.Get(0).(func(string, artifact.Artifact, bool) artifact.Status); ok {
r0 = rf(workDir, art, shortCircuit)
} else {
r0 = ret.Get(0).(artifact.Status)
}
var r1 error
if rf, ok := ret.Get(1).(func(string, artifact.Artifact, bool) error); ok {
r1 = rf(workDir, art, shortCircuit)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
type mockConstructorTestingTNewCache interface {
mock.TestingT
Cleanup(func())
}
// NewCache creates a new instance of Cache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewCache(t mockConstructorTestingTNewCache) *Cache {
mock := &Cache{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}