122 lines
3.1 KiB
Go
122 lines
3.1 KiB
Go
// Code generated by counterfeiter. DO NOT EDIT.
|
|
package testfakes
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"k8s.io/kubectl/pkg/framework/test"
|
|
)
|
|
|
|
type FakeEtcdStartStopper struct {
|
|
StartStub func(etcdURL, datadir string) error
|
|
startMutex sync.RWMutex
|
|
startArgsForCall []struct {
|
|
etcdURL string
|
|
datadir string
|
|
}
|
|
startReturns struct {
|
|
result1 error
|
|
}
|
|
startReturnsOnCall map[int]struct {
|
|
result1 error
|
|
}
|
|
StopStub func()
|
|
stopMutex sync.RWMutex
|
|
stopArgsForCall []struct{}
|
|
invocations map[string][][]interface{}
|
|
invocationsMutex sync.RWMutex
|
|
}
|
|
|
|
func (fake *FakeEtcdStartStopper) Start(etcdURL string, datadir string) error {
|
|
fake.startMutex.Lock()
|
|
ret, specificReturn := fake.startReturnsOnCall[len(fake.startArgsForCall)]
|
|
fake.startArgsForCall = append(fake.startArgsForCall, struct {
|
|
etcdURL string
|
|
datadir string
|
|
}{etcdURL, datadir})
|
|
fake.recordInvocation("Start", []interface{}{etcdURL, datadir})
|
|
fake.startMutex.Unlock()
|
|
if fake.StartStub != nil {
|
|
return fake.StartStub(etcdURL, datadir)
|
|
}
|
|
if specificReturn {
|
|
return ret.result1
|
|
}
|
|
return fake.startReturns.result1
|
|
}
|
|
|
|
func (fake *FakeEtcdStartStopper) StartCallCount() int {
|
|
fake.startMutex.RLock()
|
|
defer fake.startMutex.RUnlock()
|
|
return len(fake.startArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeEtcdStartStopper) StartArgsForCall(i int) (string, string) {
|
|
fake.startMutex.RLock()
|
|
defer fake.startMutex.RUnlock()
|
|
return fake.startArgsForCall[i].etcdURL, fake.startArgsForCall[i].datadir
|
|
}
|
|
|
|
func (fake *FakeEtcdStartStopper) StartReturns(result1 error) {
|
|
fake.StartStub = nil
|
|
fake.startReturns = struct {
|
|
result1 error
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeEtcdStartStopper) StartReturnsOnCall(i int, result1 error) {
|
|
fake.StartStub = nil
|
|
if fake.startReturnsOnCall == nil {
|
|
fake.startReturnsOnCall = make(map[int]struct {
|
|
result1 error
|
|
})
|
|
}
|
|
fake.startReturnsOnCall[i] = struct {
|
|
result1 error
|
|
}{result1}
|
|
}
|
|
|
|
func (fake *FakeEtcdStartStopper) Stop() {
|
|
fake.stopMutex.Lock()
|
|
fake.stopArgsForCall = append(fake.stopArgsForCall, struct{}{})
|
|
fake.recordInvocation("Stop", []interface{}{})
|
|
fake.stopMutex.Unlock()
|
|
if fake.StopStub != nil {
|
|
fake.StopStub()
|
|
}
|
|
}
|
|
|
|
func (fake *FakeEtcdStartStopper) StopCallCount() int {
|
|
fake.stopMutex.RLock()
|
|
defer fake.stopMutex.RUnlock()
|
|
return len(fake.stopArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeEtcdStartStopper) Invocations() map[string][][]interface{} {
|
|
fake.invocationsMutex.RLock()
|
|
defer fake.invocationsMutex.RUnlock()
|
|
fake.startMutex.RLock()
|
|
defer fake.startMutex.RUnlock()
|
|
fake.stopMutex.RLock()
|
|
defer fake.stopMutex.RUnlock()
|
|
copiedInvocations := map[string][][]interface{}{}
|
|
for key, value := range fake.invocations {
|
|
copiedInvocations[key] = value
|
|
}
|
|
return copiedInvocations
|
|
}
|
|
|
|
func (fake *FakeEtcdStartStopper) 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 _ test.EtcdStartStopper = new(FakeEtcdStartStopper)
|