1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/volumes/volume_test.go
Brian Goff 132d0028ba Adds unit tests for volumes
Cleans up some dead code

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-02-04 10:53:31 -05:00

19 lines
337 B
Go

package volumes
import "testing"
func TestContainers(t *testing.T) {
v := &Volume{containers: make(map[string]struct{})}
id := "1234"
v.AddContainer(id)
if v.Containers()[0] != id {
t.Fatalf("adding a container ref failed")
}
v.RemoveContainer(id)
if len(v.Containers()) != 0 {
t.Fatalf("removing container failed")
}
}