-
Notifications
You must be signed in to change notification settings - Fork 71
/
org_checker_cli.go
94 lines (85 loc) · 2.4 KB
/
org_checker_cli.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
// Code generated by counterfeiter. DO NOT EDIT.
package fakes
import (
"sync"
)
type OrgCheckerCli struct {
TargetOrgStub func(name string) error
targetOrgMutex sync.RWMutex
targetOrgArgsForCall []struct {
name string
}
targetOrgReturns struct {
result1 error
}
targetOrgReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *OrgCheckerCli) TargetOrg(name string) error {
fake.targetOrgMutex.Lock()
ret, specificReturn := fake.targetOrgReturnsOnCall[len(fake.targetOrgArgsForCall)]
fake.targetOrgArgsForCall = append(fake.targetOrgArgsForCall, struct {
name string
}{name})
fake.recordInvocation("TargetOrg", []interface{}{name})
fake.targetOrgMutex.Unlock()
if fake.TargetOrgStub != nil {
return fake.TargetOrgStub(name)
}
if specificReturn {
return ret.result1
}
return fake.targetOrgReturns.result1
}
func (fake *OrgCheckerCli) TargetOrgCallCount() int {
fake.targetOrgMutex.RLock()
defer fake.targetOrgMutex.RUnlock()
return len(fake.targetOrgArgsForCall)
}
func (fake *OrgCheckerCli) TargetOrgArgsForCall(i int) string {
fake.targetOrgMutex.RLock()
defer fake.targetOrgMutex.RUnlock()
return fake.targetOrgArgsForCall[i].name
}
func (fake *OrgCheckerCli) TargetOrgReturns(result1 error) {
fake.TargetOrgStub = nil
fake.targetOrgReturns = struct {
result1 error
}{result1}
}
func (fake *OrgCheckerCli) TargetOrgReturnsOnCall(i int, result1 error) {
fake.TargetOrgStub = nil
if fake.targetOrgReturnsOnCall == nil {
fake.targetOrgReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.targetOrgReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *OrgCheckerCli) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.targetOrgMutex.RLock()
defer fake.targetOrgMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *OrgCheckerCli) 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)
}