forked from alexei-led/pumba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPIClient_test.go
29 lines (25 loc) · 878 Bytes
/
APIClient_test.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
package mocks
import (
"reflect"
"testing"
"github.com/docker/docker/client"
)
func TestMockAPIClient(t *testing.T) {
mock := new(APIClient)
iface := reflect.TypeOf((*client.ContainerAPIClient)(nil)).Elem()
if !reflect.TypeOf(mock).Implements(iface) {
t.Fatalf("Mock does not implement the ContainerAPIClient interface")
}
iface = reflect.TypeOf((*client.ImageAPIClient)(nil)).Elem()
if !reflect.TypeOf(mock).Implements(iface) {
t.Fatalf("Mock does not implement the ImageAPIClient interface")
}
iface = reflect.TypeOf((*client.NetworkAPIClient)(nil)).Elem()
if !reflect.TypeOf(mock).Implements(iface) {
t.Fatalf("Mock does not implement the NetworkAPIClient interface")
}
iface = reflect.TypeOf((*client.VolumeAPIClient)(nil)).Elem()
if !reflect.TypeOf(mock).Implements(iface) {
t.Fatalf("Mock does not implement the VolumeAPIClient interface")
}
}