test(lifecycle): add unit tests for lifecycle behavior
SonarQube Scan / SonarQube Trigger (push) Successful in 2m15s
SonarQube Scan / SonarQube Trigger (push) Successful in 2m15s
This commit is contained in:
@@ -33,6 +33,10 @@ func (m *mockSession) Detail() *types.Detail {
|
||||
|
||||
type mockLifecycle struct{ user string }
|
||||
|
||||
func (ml *mockLifecycle) Channel() ssh.Channel {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ml *mockLifecycle) Connection() ssh.Conn { return nil }
|
||||
func (ml *mockLifecycle) PortRegistry() port.Port { return nil }
|
||||
func (ml *mockLifecycle) SetChannel(channel ssh.Channel) { _ = channel }
|
||||
|
||||
@@ -100,6 +100,11 @@ type MockLifecycle struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *MockLifecycle) Channel() ssh.Channel {
|
||||
args := m.Called()
|
||||
return args.Get(0).(ssh.Channel)
|
||||
}
|
||||
|
||||
func (m *MockLifecycle) Connection() ssh.Conn {
|
||||
args := m.Called()
|
||||
return args.Get(0).(ssh.Conn)
|
||||
|
||||
Reference in New Issue
Block a user