forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_index_blobs.go
133 lines (119 loc) · 3.44 KB
/
fake_index_blobs.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// This file was generated by counterfeiter
package indexfakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/releasedir/index"
)
type FakeIndexBlobs struct {
GetStub func(name, blobID, sha1 string) (string, error)
getMutex sync.RWMutex
getArgsForCall []struct {
name string
blobID string
sha1 string
}
getReturns struct {
result1 string
result2 error
}
AddStub func(name, path, sha1 string) (string, string, error)
addMutex sync.RWMutex
addArgsForCall []struct {
name string
path string
sha1 string
}
addReturns struct {
result1 string
result2 string
result3 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeIndexBlobs) Get(name string, blobID string, sha1 string) (string, error) {
fake.getMutex.Lock()
fake.getArgsForCall = append(fake.getArgsForCall, struct {
name string
blobID string
sha1 string
}{name, blobID, sha1})
fake.recordInvocation("Get", []interface{}{name, blobID, sha1})
fake.getMutex.Unlock()
if fake.GetStub != nil {
return fake.GetStub(name, blobID, sha1)
} else {
return fake.getReturns.result1, fake.getReturns.result2
}
}
func (fake *FakeIndexBlobs) GetCallCount() int {
fake.getMutex.RLock()
defer fake.getMutex.RUnlock()
return len(fake.getArgsForCall)
}
func (fake *FakeIndexBlobs) GetArgsForCall(i int) (string, string, string) {
fake.getMutex.RLock()
defer fake.getMutex.RUnlock()
return fake.getArgsForCall[i].name, fake.getArgsForCall[i].blobID, fake.getArgsForCall[i].sha1
}
func (fake *FakeIndexBlobs) GetReturns(result1 string, result2 error) {
fake.GetStub = nil
fake.getReturns = struct {
result1 string
result2 error
}{result1, result2}
}
func (fake *FakeIndexBlobs) Add(name string, path string, sha1 string) (string, string, error) {
fake.addMutex.Lock()
fake.addArgsForCall = append(fake.addArgsForCall, struct {
name string
path string
sha1 string
}{name, path, sha1})
fake.recordInvocation("Add", []interface{}{name, path, sha1})
fake.addMutex.Unlock()
if fake.AddStub != nil {
return fake.AddStub(name, path, sha1)
} else {
return fake.addReturns.result1, fake.addReturns.result2, fake.addReturns.result3
}
}
func (fake *FakeIndexBlobs) AddCallCount() int {
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
return len(fake.addArgsForCall)
}
func (fake *FakeIndexBlobs) AddArgsForCall(i int) (string, string, string) {
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
return fake.addArgsForCall[i].name, fake.addArgsForCall[i].path, fake.addArgsForCall[i].sha1
}
func (fake *FakeIndexBlobs) AddReturns(result1 string, result2 string, result3 error) {
fake.AddStub = nil
fake.addReturns = struct {
result1 string
result2 string
result3 error
}{result1, result2, result3}
}
func (fake *FakeIndexBlobs) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.getMutex.RLock()
defer fake.getMutex.RUnlock()
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
return fake.invocations
}
func (fake *FakeIndexBlobs) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ index.IndexBlobs = new(FakeIndexBlobs)