You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
539 B
Go
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)
|
|
}
|