From 3ad2f2446805c4b3c02601a3df52ad284136f8fb Mon Sep 17 00:00:00 2001 From: Jacob LeGrone Date: Wed, 4 Sep 2019 15:56:48 -0400 Subject: [PATCH] Use public image for operation tests --- driver/driver_test.go | 11 ++++++----- testdata/operations/valid-operation.json | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/driver/driver_test.go b/driver/driver_test.go index d6448932..cd0c2eaa 100644 --- a/driver/driver_test.go +++ b/driver/driver_test.go @@ -4,7 +4,6 @@ import ( "encoding/json" "io/ioutil" "os" - "reflect" "testing" "github.com/deislabs/cnab-go/bundle" @@ -51,8 +50,9 @@ func TestOperation_Unmarshall(t *testing.T) { }, Image: bundle.InvocationImage{ BaseImage: bundle.BaseImage{ - Image: "testing.azurecr.io/duffle/test:e8966c3c153a525775cbcddd46f778bed25650b4", + Image: "cnab/helloworld:latest", ImageType: "docker", + Digest: "sha256:55f83710272990efab4e076f9281453e136980becfd879640b06552ead751284", }, }, Revision: "01DDY0MT808KX0GGZ6SMXN4TW", @@ -70,7 +70,7 @@ func TestOperation_Unmarshall(t *testing.T) { is.NoError(err, "Error reading from testdata/operations/valid-operation.json") is.NoError(json.Unmarshal(bytes, &op), "Error unmarshalling operation") is.NotNil(op, "Expected Operation not to be nil") - is.True(reflect.DeepEqual(expectedOp, op), "Validating value of unmarshalled operation failed") + is.Equal(expectedOp, op, "Validating value of unmarshalled operation failed") } func TestOperation_Marshall(t *testing.T) { @@ -83,8 +83,9 @@ func TestOperation_Marshall(t *testing.T) { }, Image: bundle.InvocationImage{ BaseImage: bundle.BaseImage{ - Image: "testing.azurecr.io/duffle/test:e8966c3c153a525775cbcddd46f778bed25650b4", + Image: "cnab/helloworld:latest", ImageType: "docker", + Digest: "sha256:55f83710272990efab4e076f9281453e136980becfd879640b06552ead751284", }, }, Revision: "01DDY0MT808KX0GGZ6SMXN4TW", @@ -110,5 +111,5 @@ func TestOperation_Marshall(t *testing.T) { is.NoError(err, "Error Marshalling expected operation to json") is.NotNil(bytes, "Expected marshalled json not to be nil") expectedJSON := string(bytes) - is.True(actualJSON == expectedJSON) + is.Equal(expectedJSON, actualJSON) } diff --git a/testdata/operations/valid-operation.json b/testdata/operations/valid-operation.json index c98be50f..6ff5eba7 100644 --- a/testdata/operations/valid-operation.json +++ b/testdata/operations/valid-operation.json @@ -7,8 +7,9 @@ "param2": "value2" }, "image": { - "image": "testing.azurecr.io/duffle/test:e8966c3c153a525775cbcddd46f778bed25650b4", - "imageType": "docker" + "image": "cnab/helloworld:latest", + "imageType": "docker", + "contentDigest": "sha256:55f83710272990efab4e076f9281453e136980becfd879640b06552ead751284" }, "environment": { "ENV1": "value1",