-
Notifications
You must be signed in to change notification settings - Fork 162
/
fake_downloader.go
59 lines (51 loc) · 1.57 KB
/
fake_downloader.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
// This file was generated by counterfeiter
package fakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/cmd"
)
type FakeDownloader struct {
DownloadStub func(blobstoreID, sha1, prefix, dstDirPath string) error
downloadMutex sync.RWMutex
downloadArgsForCall []struct {
blobstoreID string
sha1 string
prefix string
dstDirPath string
}
downloadReturns struct {
result1 error
}
}
func (fake *FakeDownloader) Download(blobstoreID string, sha1 string, prefix string, dstDirPath string) error {
fake.downloadMutex.Lock()
fake.downloadArgsForCall = append(fake.downloadArgsForCall, struct {
blobstoreID string
sha1 string
prefix string
dstDirPath string
}{blobstoreID, sha1, prefix, dstDirPath})
fake.downloadMutex.Unlock()
if fake.DownloadStub != nil {
return fake.DownloadStub(blobstoreID, sha1, prefix, dstDirPath)
} else {
return fake.downloadReturns.result1
}
}
func (fake *FakeDownloader) DownloadCallCount() int {
fake.downloadMutex.RLock()
defer fake.downloadMutex.RUnlock()
return len(fake.downloadArgsForCall)
}
func (fake *FakeDownloader) DownloadArgsForCall(i int) (string, string, string, string) {
fake.downloadMutex.RLock()
defer fake.downloadMutex.RUnlock()
return fake.downloadArgsForCall[i].blobstoreID, fake.downloadArgsForCall[i].sha1, fake.downloadArgsForCall[i].prefix, fake.downloadArgsForCall[i].dstDirPath
}
func (fake *FakeDownloader) DownloadReturns(result1 error) {
fake.DownloadStub = nil
fake.downloadReturns = struct {
result1 error
}{result1}
}
var _ cmd.Downloader = new(FakeDownloader)