integration/config: don't string-match errors

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-08-19 15:33:48 +02:00
parent 348f412d85
commit 18cae89436
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -14,6 +14,7 @@ import (
"github.com/docker/docker/api/types/filters"
swarmtypes "github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/client"
"github.com/docker/docker/errdefs"
"github.com/docker/docker/integration/internal/swarm"
"github.com/docker/docker/pkg/stdcopy"
"github.com/docker/docker/testutil/daemon"
@ -151,8 +152,9 @@ func TestConfigsCreateAndDelete(t *testing.T) {
err = c.ConfigRemove(ctx, configID)
assert.NilError(t, err)
insp, _, err = c.ConfigInspectWithRaw(ctx, configID)
assert.Check(t, is.ErrorContains(err, "No such config"))
_, _, err = c.ConfigInspectWithRaw(ctx, configID)
assert.Check(t, errdefs.IsNotFound(err))
assert.Check(t, is.ErrorContains(err, configID))
}
func TestConfigsUpdate(t *testing.T) {
@ -203,6 +205,7 @@ func TestConfigsUpdate(t *testing.T) {
// this test will produce an error in func UpdateConfig
insp.Spec.Data = []byte("TESTINGDATA2")
err = c.ConfigUpdate(ctx, configID, insp.Version, insp.Spec)
assert.Check(t, errdefs.IsInvalidParameter(err))
assert.Check(t, is.ErrorContains(err, "only updates to Labels are allowed"))
}