1
0
mirror of https://github.com/containrrr/watchtower.git synced 2024-12-15 09:14:13 +02:00
watchtower/docker/container_test.go
Brian DeHamer c02c4b9ec1 Handle container links
Ensures that linked containers are restarted if any of their
dependencies are restarted -- and makes sure that everything happens in
the correct order.
2015-07-15 22:22:00 +00:00

33 lines
539 B
Go

package docker
import (
"testing"
"github.com/samalba/dockerclient"
"github.com/stretchr/testify/assert"
)
func TestName(t *testing.T) {
c := Container{
containerInfo: &dockerclient.ContainerInfo{Name: "foo"},
}
name := c.Name()
assert.Equal(t, "foo", name)
}
func TestLinks(t *testing.T) {
c := Container{
containerInfo: &dockerclient.ContainerInfo{
HostConfig: &dockerclient.HostConfig{
Links: []string{"foo:foo", "bar:bar"},
},
},
}
links := c.Links()
assert.Equal(t, []string{"foo", "bar"}, links)
}