Skip to content

Commit

Permalink
Use public image for operation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jlegrone committed Sep 4, 2019
1 parent 1170345 commit 3ad2f24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"io/ioutil"
"os"
"reflect"
"testing"

"github.com/deislabs/cnab-go/bundle"
Expand Down Expand Up @@ -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",
Expand All @@ -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) {
Expand All @@ -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",
Expand All @@ -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)
}
5 changes: 3 additions & 2 deletions testdata/operations/valid-operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 3ad2f24

Please sign in to comment.