1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

integration/secret: fix TestSecretInspect not actually checking response

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

View file

@ -3,6 +3,7 @@ package secret // import "github.com/docker/docker/integration/secret"
import (
"bytes"
"context"
"encoding/json"
"sort"
"testing"
"time"
@ -30,16 +31,17 @@ func TestSecretInspect(t *testing.T) {
ctx := context.Background()
testName := "test_secret_" + t.Name()
testName := t.Name()
secretID := createSecret(ctx, t, c, testName, []byte("TESTINGDATA"), nil)
secret, _, err := c.SecretInspectWithRaw(context.Background(), secretID)
insp, body, err := c.SecretInspectWithRaw(ctx, secretID)
assert.NilError(t, err)
assert.Check(t, is.Equal(secret.Spec.Name, testName))
assert.Check(t, is.Equal(insp.Spec.Name, testName))
secret, _, err = c.SecretInspectWithRaw(context.Background(), testName)
var secret swarmtypes.Secret
err = json.Unmarshal(body, &secret)
assert.NilError(t, err)
assert.Check(t, is.Equal(secretID, secretID))
assert.Check(t, is.DeepEqual(secret, insp))
}
func TestSecretList(t *testing.T) {