Make SessionSetup faster and support for command execution
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
@@ -13,6 +14,11 @@ type Mock struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *Mock) GetClient() *client.Client {
|
||||
args := m.Called()
|
||||
return args.Get(0).(*client.Client)
|
||||
}
|
||||
|
||||
func (m *Mock) CreateNetwork(id string, opts types.NetworkCreate) error {
|
||||
args := m.Called(id, opts)
|
||||
return args.Error(0)
|
||||
@@ -96,8 +102,8 @@ func (m *Mock) Exec(instanceName string, command []string) (int, error) {
|
||||
args := m.Called(instanceName, command)
|
||||
return args.Int(0), args.Error(1)
|
||||
}
|
||||
func (m *Mock) SwarmInit() (*SwarmTokens, error) {
|
||||
args := m.Called()
|
||||
func (m *Mock) SwarmInit(advertiseAddr string) (*SwarmTokens, error) {
|
||||
args := m.Called(advertiseAddr)
|
||||
return args.Get(0).(*SwarmTokens), args.Error(1)
|
||||
}
|
||||
func (m *Mock) SwarmJoin(addr, token string) error {
|
||||
|
||||
Reference in New Issue
Block a user