-
Notifications
You must be signed in to change notification settings - Fork 162
/
fake_session.go
75 lines (65 loc) · 1.65 KB
/
fake_session.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
// This file was generated by counterfeiter
package fakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/ssh"
)
type FakeSession struct {
StartStub func() ([]string, error)
startMutex sync.RWMutex
startArgsForCall []struct{}
startReturns struct {
result1 []string
result2 error
}
FinishStub func() error
finishMutex sync.RWMutex
finishArgsForCall []struct{}
finishReturns struct {
result1 error
}
}
func (fake *FakeSession) Start() ([]string, error) {
fake.startMutex.Lock()
fake.startArgsForCall = append(fake.startArgsForCall, struct{}{})
fake.startMutex.Unlock()
if fake.StartStub != nil {
return fake.StartStub()
} else {
return fake.startReturns.result1, fake.startReturns.result2
}
}
func (fake *FakeSession) StartCallCount() int {
fake.startMutex.RLock()
defer fake.startMutex.RUnlock()
return len(fake.startArgsForCall)
}
func (fake *FakeSession) StartReturns(result1 []string, result2 error) {
fake.StartStub = nil
fake.startReturns = struct {
result1 []string
result2 error
}{result1, result2}
}
func (fake *FakeSession) Finish() error {
fake.finishMutex.Lock()
fake.finishArgsForCall = append(fake.finishArgsForCall, struct{}{})
fake.finishMutex.Unlock()
if fake.FinishStub != nil {
return fake.FinishStub()
} else {
return fake.finishReturns.result1
}
}
func (fake *FakeSession) FinishCallCount() int {
fake.finishMutex.RLock()
defer fake.finishMutex.RUnlock()
return len(fake.finishArgsForCall)
}
func (fake *FakeSession) FinishReturns(result1 error) {
fake.FinishStub = nil
fake.finishReturns = struct {
result1 error
}{result1}
}
var _ ssh.Session = new(FakeSession)