Skip to content

Commit

Permalink
Patch up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mweagle committed Oct 7, 2016
1 parent d6932c4 commit 3e543b1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions func_importvalue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (testSuite *ImportValueFuncTest) TestRef(c *C) {
inputBuf := `{"Fn::ImportValue" : "sharedValueToImport"}`
f, err := unmarshalFunc([]byte(inputBuf))
c.Assert(err, IsNil)
c.Assert(f.(StringFunc).String(), DeepEquals, ImportValue("sharedValueToImport").String())
c.Assert(f.(StringFunc).String(), DeepEquals, ImportValue(String("sharedValueToImport")).String())

// tidy the JSON input
inputStruct := map[string]interface{}{}
Expand All @@ -27,14 +27,10 @@ func (testSuite *ImportValueFuncTest) TestRef(c *C) {
}

func (testSuite *ImportValueFuncTest) TestFailures(c *C) {
inputBuf := `{"Fn::ImportValue": {"Fn::ImportValue": "foo"}}`
inputBuf := `{"Fn::ImportValue": ["1"]}`
_, err := unmarshalFunc([]byte(inputBuf))
c.Assert(err, ErrorMatches, "cannot decode function")

inputBuf = `{"Fn::ImportValue": ["1"]}`
_, err = unmarshalFunc([]byte(inputBuf))
c.Assert(err, ErrorMatches, "cannot decode function")

inputBuf = `{"Fn::ImportValue": true}`
_, err = unmarshalFunc([]byte(inputBuf))
c.Assert(err, ErrorMatches, "cannot decode function")
Expand Down

0 comments on commit 3e543b1

Please sign in to comment.