Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Victor Vieux 2015-03-11 14:29:21 -07:00 committed by Victor Vieux
parent bc17fbd6f7
commit af05bfd0ba
3 changed files with 14 additions and 6 deletions

View File

@ -5,6 +5,7 @@ import (
"testing"
"github.com/docker/swarm/cluster"
"github.com/samalba/dockerclient"
"github.com/stretchr/testify/assert"
)
@ -19,6 +20,7 @@ func (fw *FakeWriter) Write(p []byte) (n int, err error) {
type FakeNode struct{}
func (fn *FakeNode) DockerClient() dockerclient.Client { return nil }
func (fn *FakeNode) ID() string { return "node_id" }
func (fn *FakeNode) Name() string { return "node_name" }
func (fn *FakeNode) IP() string { return "node_ip" }

View File

@ -1,6 +1,9 @@
package filter
import "github.com/docker/swarm/cluster"
import (
"github.com/docker/swarm/cluster"
"github.com/samalba/dockerclient"
)
type FakeNode struct {
id string
@ -11,11 +14,12 @@ type FakeNode struct {
labels map[string]string
}
func (fn *FakeNode) ID() string { return fn.id }
func (fn *FakeNode) Name() string { return fn.name }
func (fn *FakeNode) IP() string { return "" }
func (fn *FakeNode) Addr() string { return fn.addr }
func (fn *FakeNode) Images() []*cluster.Image { return fn.images }
func (fn *FakeNode) DockerClient() dockerclient.Client { return nil }
func (fn *FakeNode) ID() string { return fn.id }
func (fn *FakeNode) Name() string { return fn.name }
func (fn *FakeNode) IP() string { return "" }
func (fn *FakeNode) Addr() string { return fn.addr }
func (fn *FakeNode) Images() []*cluster.Image { return fn.images }
func (fn *FakeNode) Image(id string) *cluster.Image {
for _, image := range fn.images {
if image.Id == id {

View File

@ -4,6 +4,7 @@ import (
"errors"
"github.com/docker/swarm/cluster"
"github.com/samalba/dockerclient"
)
type FakeNode struct {
@ -17,6 +18,7 @@ type FakeNode struct {
containers []*cluster.Container
}
func (fn *FakeNode) DockerClient() dockerclient.Client { return nil }
func (fn *FakeNode) ID() string { return fn.id }
func (fn *FakeNode) Name() string { return fn.name }
func (fn *FakeNode) IP() string { return "" }