-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow specifying of Cloudformation template parameters (#123)
* Use correct type for body response * Use correct type for statusCode * Return 502 if status code is malformed * Update Goformation to latest version * Allow specifying of Cloudformation template parameters
- Loading branch information
Showing
660 changed files
with
2,399 additions
and
3,332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package main | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("Parse Cloudformation parameters", func() { | ||
|
||
Context("with normal input", func() { | ||
|
||
It("returns empty map when input is missing", func() { | ||
p := parseParameters("") | ||
Expect(p).To(BeEmpty()) | ||
}) | ||
|
||
It("returns expected values when input is correct", func() { | ||
p := parseParameters("ParameterKey=KeyPairName,ParameterValue=MyKey ParameterKey=InstanceType,ParameterValue=t1.micro") | ||
Expect(p).To(HaveLen(2)) | ||
Expect(p).To(HaveKeyWithValue("KeyPairName", "MyKey")) | ||
Expect(p).To(HaveKeyWithValue("InstanceType", "t1.micro")) | ||
}) | ||
|
||
It("returns partial values when input is malformed", func() { | ||
p := parseParameters("ParameterKey=KeyPairName,ParameterValue=MyKey Para") | ||
Expect(p).To(HaveLen(1)) | ||
Expect(p).To(HaveKeyWithValue("KeyPairName", "MyKey")) | ||
}) | ||
}) | ||
|
||
Context("with escaped input", func() { | ||
|
||
It("returns expected values when keys or values are quoted", func() { | ||
p := parseParameters(`ParameterKey="KeyPairName",ParameterValue="MyKey " ParameterKey=InstanceType,ParameterValue=t1\ mic\ ro`) | ||
Expect(p).To(HaveLen(2)) | ||
Expect(p).To(HaveKeyWithValue("KeyPairName", "MyKey ")) | ||
Expect(p).To(HaveKeyWithValue("InstanceType", "t1 mic ro")) | ||
}) | ||
|
||
It("handles wrong quotings", func() { | ||
p := parseParameters(`ParameterKey="KeyPairName,ParameterValue="MyKey" ParameterKey=InstanceType,ParameterValue=t1\ micro`) | ||
Expect(p).To(HaveLen(1)) | ||
Expect(p).To(HaveKeyWithValue("InstanceType", "t1 micro")) | ||
}) | ||
|
||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
vendor/github.com/awslabs/goformation/cloudformation/aws-apigateway-account.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.