Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted the parser tests to Proof. Many of them were redundant. They were created at a time when I thought that it would be reasonable to implement all the examples in the AWS documentation. I suppose it didn't seem like such a great idea somewhere in the middle of the "d"s. Keeping them, though. Tests are tests. But many have the same XML structure, while some have identical XML.
- Loading branch information
1 parent
67a4b88
commit f5f7b79
Showing
20 changed files
with
226 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("AllocateAddress", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = { "publicIp": "67.202.55.255" }; | ||
deepEqual(expected, object, "parse allocate address"); | ||
}); |
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,14 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("AttachVolume", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ volumeId: "vol-4d826724" | ||
, instanceId: "i-6058a509" | ||
, device: "/dev/sdh" | ||
, status: "attaching" | ||
, attachTime: new Date(Date.UTC(2008, 4, 7, 11, 51, 50)) | ||
}; | ||
deepEqual(expected, object, "parse attach volume"); | ||
}); |
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,9 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("AuthorizeSecurityGroupIngress", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = { "return": true }; | ||
deepEqual(expected, object, "parse authorize security group ingress"); | ||
}); | ||
|
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,24 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("BundleInstance", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ requestId: "bun-c1a540a8" | ||
, bundleInstanceTask: | ||
{ instanceId: "i-12345678" | ||
, bundleId: "bun-c1a540a8" | ||
, state: "bundling" | ||
, startTime: new Date(Date.UTC(2008, 9, 7, 11, 41, 50)) | ||
, updateTime: new Date(Date.UTC(2008, 9, 7, 11, 51, 50)) | ||
, progress: "70%" | ||
, storage: | ||
{ S3: | ||
{ bucket: "my-bucket" | ||
, prefix: "winami" | ||
} | ||
} | ||
} | ||
}; | ||
deepEqual(expected, object, "parse bundle instance"); | ||
}); |
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,24 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("CancelBundleTask", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ bundleInstanceTask: | ||
{ instanceId: "i-12345678" | ||
, bundleId: "bun-cla322b9" | ||
, state: "canceling" | ||
, startTime: new Date(Date.UTC(2008, 9, 7, 11, 41, 50)) | ||
, updateTime: new Date(Date.UTC(2008, 9, 7, 11, 51, 50)) | ||
, progress: "20%" | ||
, storage: | ||
{ S3: | ||
{ bucket: "my-bucket" | ||
, prefix: "my-new-image" | ||
} | ||
} | ||
} | ||
}; | ||
deepEqual(expected, object, "parse cancel bundle task"); | ||
}); | ||
|
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,11 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("CancelSpotInstanceRequests", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ requestId: "59dbff89-35bd-4eac-99ed-be587ed81825" | ||
, spotInstanceRequestSet: [ { spotInstanceRequestId: 'sir-e95fae02', state: "cancelled" } ] | ||
}; | ||
deepEqual(expected, object, "parse cancel spot instance requests"); | ||
}); |
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,11 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("ConfirmProductInstance", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ ownerId: "254933287430" | ||
, "return": true | ||
}; | ||
deepEqual(expected, object, "parse confirm product instance"); | ||
}); |
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,8 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("CreateImage", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = { imageId: "ami-4fa54026" }; | ||
deepEqual(expected, object, "parse create image"); | ||
}); |
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,12 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("CreateKeyPair", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ keyName: "gsg-keypair" | ||
, keyFingerprint: "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f" | ||
, keyMaterial: "-----BEGIN RSA PRIVATE KEY-----\nMIIEoQIBAAKCAQBuLFg5ujHrtm1jnutSuoO8Xe56LlT+HM8v/xkaa39EstM3/aFxTHgElQiJLChp\nHungXQ29VTc8rc1bW0lkdi23OH5eqkMHGhvEwqa0HWASUMll4o3o/IX+0f2UcPoKCOVUR+jx71Sg\n5AU52EQfanIn3ZQ8lFW7Edp5a3q4DhjGlUKToHVbicL5E+g45zfB95wIyywWZfeW/UUF3LpGZyq/\nebIUlq1qTbHkLbCC2r7RTn8vpQWp47BGVYGtGSBMpTRP5hnbzzuqj3itkiLHjU39S2sJCJ0TrJx5\ni8BygR4s3mHKBj8l+ePQxG1kGbF6R4yg6sECmXn17MRQVXODNHZbAgMBAAECggEAY1tsiUsIwDl5\n91CXirkYGuVfLyLflXenxfI50mDFms/mumTqloHO7tr0oriHDR5K7wMcY/YY5YkcXNo7mvUVD1pM\nZNUJs7rw9gZRTrf7LylaJ58kOcyajw8TsC4e4LPbFaHwS1d6K8rXh64o6WgW4SrsB6ICmr1kGQI7\n3wcfgt5ecIu4TZf0OE9IHjn+2eRlsrjBdeORi7KiUNC/pAG23I6MdDOFEQRcCSigCj+4/mciFUSA\nSWS4dMbrpb9FNSIcf9dcLxVM7/6KxgJNfZc9XWzUw77Jg8x92Zd0fVhHOux5IZC+UvSKWB4dyfcI\ntE8C3p9bbU9VGyY5vLCAiIb4qQKBgQDLiO24GXrIkswF32YtBBMuVgLGCwU9h9HlO9mKAc2m8Cm1\njUE5IpzRjTedc9I2qiIMUTwtgnw42auSCzbUeYMURPtDqyQ7p6AjMujp9EPemcSVOK9vXYL0Ptco\nxW9MC0dtV6iPkCN7gOqiZXPRKaFbWADp16p8UAIvS/a5XXk5jwKBgQCKkpHi2EISh1uRkhxljyWC\niDCiK6JBRsMvpLbc0v5dKwP5alo1fmdR5PJaV2qvZSj5CYNpMAy1/EDNTY5OSIJU+0KFmQbyhsbm\nrdLNLDL4+TcnT7c62/aH01ohYaf/VCbRhtLlBfqGoQc7+sAc8vmKkesnF7CqCEKDyF/dhrxYdQKB\ngC0iZzzNAapayz1+JcVTwwEid6j9JqNXbBc+Z2YwMi+T0Fv/P/hwkX/ypeOXnIUcw0Ih/YtGBVAC\nDQbsz7LcY1HqXiHKYNWNvXgwwO+oiChjxvEkSdsTTIfnK4VSCvU9BxDbQHjdiNDJbL6oar92UN7V\nrBYvChJZF7LvUH4YmVpHAoGAbZ2X7XvoeEO+uZ58/BGKOIGHByHBDiXtzMhdJr15HTYjxK7OgTZm\ngK+8zp4L9IbvLGDMJO8vft32XPEWuvI8twCzFH+CsWLQADZMZKSsBasOZ/h1FwhdMgCMcY+Qlzd4\nJZKjTSu3i7vhvx6RzdSedXEMNTZWN4qlIx3kR5aHcukCgYA9T+Zrvm1F0seQPbLknn7EqhXIjBaT\nP8TTvW/6bdPi23ExzxZn7KOdrfclYRph1LHMpAONv/x2xALIf91UB+v5ohy1oDoasL0gij1houRe\n2ERKKdwz0ZL9SWq6VTdhr/5G994CK72fy5WhyERbDjUIdHaK3M849JJuf8cSrvSb4g==\n-----END RSA PRIVATE KEY-----" | ||
}; | ||
deepEqual(expected, object, "parse errors"); | ||
}); |
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,11 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("CreatePlacementGroup", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ requestId: "d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE" | ||
, "return": true | ||
}; | ||
deepEqual(expected, object, "parse create placement group"); | ||
}); |
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,8 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("CreateSecurityGroup", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = { "return": true }; | ||
deepEqual(expected, object, "parse errors"); | ||
}); |
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,18 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("CreateSnapshot", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ snapshotId: "snap-78a54011" | ||
, volumeId: "vol-4d826724" | ||
, volumeSize: 10 | ||
, status: "pending" | ||
, startTime: new Date(Date.UTC(2008, 4, 7, 12, 51, 50)) | ||
, progress: "60%" | ||
, ownerId: "213457642086" | ||
, description: "Daily Backup" | ||
}; | ||
deepEqual(expected, object, "parse create snapshot"); | ||
}); | ||
|
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,16 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("CreateSpotDatafeedSubscription", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ spotDatafeedSubscription: | ||
{ ownerId: "254933287430" | ||
, bucket: "my-bucket" | ||
, prefix: null | ||
, state: "open" | ||
} | ||
}; | ||
deepEqual(expected, object, "parse create spot datafeed subscription"); | ||
}); | ||
|
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,16 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("CreateVolume", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ volumeId: "vol-4d826724" | ||
, size: 800 | ||
, status: "creating" | ||
, createTime: new Date(Date.UTC(2008, 4, 7, 11, 51, 50)) | ||
, availabilityZone: "us-east-1a" | ||
, snapshotId: null | ||
}; | ||
deepEqual(expected, object, "parse create volume"); | ||
}); | ||
|
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,8 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("DeleteKeyPair", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = { "return": true }; | ||
deepEqual(expected, object, "parse delete key pair"); | ||
}); |
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,11 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("DeletePlacementGroup", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = | ||
{ requestId: "d4904fd9-82c2-4ea5-adfe-a9cc3EXAMPLE" | ||
, "return": true | ||
}; | ||
deepEqual(expected, object, "parse delete placement group"); | ||
}); |
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,8 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("DeleteSecurityGroup", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = { "return": true }; | ||
deepEqual(expected, object, "parse delete security group"); | ||
}); |
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,8 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./proof")(1, function (parse, callback) { | ||
parse("DeleteSnapshot", callback("object")); | ||
}, function (object, deepEqual) { | ||
var expected = { "return": true }; | ||
deepEqual(expected, object, "parse delete snapshot"); | ||
}); |
This file was deleted.
Oops, something went wrong.