moby/daemon/list_test.go
Vincent Demeester 3845728524
Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-13 09:04:30 +02:00

26 lines
553 B
Go

package daemon
import (
"testing"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/container"
"gotest.tools/assert"
is "gotest.tools/assert/cmp"
)
func TestListInvalidFilter(t *testing.T) {
db, err := container.NewViewDB()
assert.Assert(t, err == nil)
d := &Daemon{
containersReplica: db,
}
f := filters.NewArgs(filters.Arg("invalid", "foo"))
_, err = d.Containers(&types.ContainerListOptions{
Filters: f,
})
assert.Assert(t, is.Error(err, "Invalid filter 'invalid'"))
}