From 1f10817b4bf669909f6d0ebfce10edf9c2c04491 Mon Sep 17 00:00:00 2001 From: Fabrizio Steiner Date: Fri, 2 Mar 2018 22:26:39 +0100 Subject: [PATCH] Removed unused mock code. --- container/mockclient/mock.go | 42 ------------------------------- container/mockclient/mock_test.go | 17 ------------- 2 files changed, 59 deletions(-) delete mode 100644 container/mockclient/mock.go delete mode 100644 container/mockclient/mock_test.go diff --git a/container/mockclient/mock.go b/container/mockclient/mock.go deleted file mode 100644 index 62cd321..0000000 --- a/container/mockclient/mock.go +++ /dev/null @@ -1,42 +0,0 @@ -package mockclient - -import ( - "time" - - "github.com/stretchr/testify/mock" - "github.com/v2tec/watchtower/container" -) - -type MockClient struct { - mock.Mock -} - -func (m *MockClient) ListContainers(cf container.Filter) ([]container.Container, error) { - args := m.Called(cf) - return args.Get(0).([]container.Container), args.Error(1) -} - -func (m *MockClient) StopContainer(c container.Container, timeout time.Duration) error { - args := m.Called(c, timeout) - return args.Error(0) -} - -func (m *MockClient) StartContainer(c container.Container) error { - args := m.Called(c) - return args.Error(0) -} - -func (m *MockClient) RenameContainer(c container.Container, name string) error { - args := m.Called(c, name) - return args.Error(0) -} - -func (m *MockClient) IsContainerStale(c container.Container) (bool, error) { - args := m.Called(c) - return args.Bool(0), args.Error(1) -} - -func (m *MockClient) RemoveImage(c container.Container) error { - args := m.Called(c) - return args.Error(0) -} diff --git a/container/mockclient/mock_test.go b/container/mockclient/mock_test.go deleted file mode 100644 index 234a218..0000000 --- a/container/mockclient/mock_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package mockclient - -import ( - "reflect" - "testing" - - "github.com/v2tec/watchtower/container" -) - -func TestMockInterface(t *testing.T) { - iface := reflect.TypeOf((*container.Client)(nil)).Elem() - mock := &MockClient{} - - if !reflect.TypeOf(mock).Implements(iface) { - t.Fatalf("Mock does not implement the Client interface") - } -}