-
Notifications
You must be signed in to change notification settings - Fork 161
/
fake_file_reporter.go
124 lines (110 loc) · 3.51 KB
/
fake_file_reporter.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
// This file was generated by counterfeiter
package directorfakes
import (
"io"
"sync"
"github.com/cloudfoundry/bosh-cli/director"
)
type FakeFileReporter struct {
TrackUploadStub func(int64, io.ReadCloser) io.ReadCloser
trackUploadMutex sync.RWMutex
trackUploadArgsForCall []struct {
arg1 int64
arg2 io.ReadCloser
}
trackUploadReturns struct {
result1 io.ReadCloser
}
TrackDownloadStub func(int64, io.Writer) io.Writer
trackDownloadMutex sync.RWMutex
trackDownloadArgsForCall []struct {
arg1 int64
arg2 io.Writer
}
trackDownloadReturns struct {
result1 io.Writer
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeFileReporter) TrackUpload(arg1 int64, arg2 io.ReadCloser) io.ReadCloser {
fake.trackUploadMutex.Lock()
fake.trackUploadArgsForCall = append(fake.trackUploadArgsForCall, struct {
arg1 int64
arg2 io.ReadCloser
}{arg1, arg2})
fake.recordInvocation("TrackUpload", []interface{}{arg1, arg2})
fake.trackUploadMutex.Unlock()
if fake.TrackUploadStub != nil {
return fake.TrackUploadStub(arg1, arg2)
} else {
return fake.trackUploadReturns.result1
}
}
func (fake *FakeFileReporter) TrackUploadCallCount() int {
fake.trackUploadMutex.RLock()
defer fake.trackUploadMutex.RUnlock()
return len(fake.trackUploadArgsForCall)
}
func (fake *FakeFileReporter) TrackUploadArgsForCall(i int) (int64, io.ReadCloser) {
fake.trackUploadMutex.RLock()
defer fake.trackUploadMutex.RUnlock()
return fake.trackUploadArgsForCall[i].arg1, fake.trackUploadArgsForCall[i].arg2
}
func (fake *FakeFileReporter) TrackUploadReturns(result1 io.ReadCloser) {
fake.TrackUploadStub = nil
fake.trackUploadReturns = struct {
result1 io.ReadCloser
}{result1}
}
func (fake *FakeFileReporter) TrackDownload(arg1 int64, arg2 io.Writer) io.Writer {
fake.trackDownloadMutex.Lock()
fake.trackDownloadArgsForCall = append(fake.trackDownloadArgsForCall, struct {
arg1 int64
arg2 io.Writer
}{arg1, arg2})
fake.recordInvocation("TrackDownload", []interface{}{arg1, arg2})
fake.trackDownloadMutex.Unlock()
if fake.TrackDownloadStub != nil {
return fake.TrackDownloadStub(arg1, arg2)
} else {
return fake.trackDownloadReturns.result1
}
}
func (fake *FakeFileReporter) TrackDownloadCallCount() int {
fake.trackDownloadMutex.RLock()
defer fake.trackDownloadMutex.RUnlock()
return len(fake.trackDownloadArgsForCall)
}
func (fake *FakeFileReporter) TrackDownloadArgsForCall(i int) (int64, io.Writer) {
fake.trackDownloadMutex.RLock()
defer fake.trackDownloadMutex.RUnlock()
return fake.trackDownloadArgsForCall[i].arg1, fake.trackDownloadArgsForCall[i].arg2
}
func (fake *FakeFileReporter) TrackDownloadReturns(result1 io.Writer) {
fake.TrackDownloadStub = nil
fake.trackDownloadReturns = struct {
result1 io.Writer
}{result1}
}
func (fake *FakeFileReporter) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.trackUploadMutex.RLock()
defer fake.trackUploadMutex.RUnlock()
fake.trackDownloadMutex.RLock()
defer fake.trackDownloadMutex.RUnlock()
return fake.invocations
}
func (fake *FakeFileReporter) 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 _ director.FileReporter = new(FakeFileReporter)