Selaa lähdekoodia

integration/config: don't string-match errors

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 5 vuotta sitten
vanhempi
commit
18cae89436
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5 2
      integration/config/config_test.go

+ 5 - 2
integration/config/config_test.go

@@ -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"))
 }