grim/convey

Add back the old --cpu-shares argument

2021-12-22, Gary Kramlich
25adcc3509c2
Add back the old --cpu-shares argument
package docker
import (
"testing"
"github.com/stretchr/testify/assert"
"keep.imfreedom.org/grim/convey/podman"
"keep.imfreedom.org/grim/convey/yaml"
)
func TestRemoveImage(t *testing.T) {
r := &Remove{
Image: "foo",
}
assert.NoError(t, r.Valid())
}
func TestRemoveImages(t *testing.T) {
r := &Remove{
Images: []string{"foo", "bar"},
}
assert.NoError(t, r.Valid())
}
func TestRemoveMerge(t *testing.T) {
r := &Remove{
Image: "foo",
Images: []string{"bar", "baz"},
}
assert.NoError(t, r.Valid())
assert.Equal(t, r.Images, yaml.StringOrSlice{"foo", "bar", "baz"})
}
func TestRemoveImagesRequired(t *testing.T) {
r := &Remove{}
assert.ErrorIs(t, r.Valid(), podman.ErrNoTags)
}