Skip to content

Commit

Permalink
added to testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske committed Jun 17, 2024
1 parent 1ffb854 commit b07928d
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions spec/02-requests/02-build_request_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe("operations protocol", function()
local config
local params
local snapshot
local binary_data

setup(function()
snapshot = assert:snapshot()
Expand All @@ -26,6 +27,8 @@ describe("operations protocol", function()


before_each(function()
binary_data = "abcd" --"\00\01\02\03"

operation = {
name = "AssumeRole",
http = {
Expand Down Expand Up @@ -76,6 +79,9 @@ describe("operations protocol", function()
RoleSessionName = {
type = "string",
},
BinaryData = {
type = "blob",
},
subStructure = {
locationName = "someSubStructure",
type = "structure",
Expand Down Expand Up @@ -124,7 +130,8 @@ describe("operations protocol", function()
hello = "the default hello thinghy",
world = "the default world thinghy"
},
subList = { 1, 2 ,3, }
subList = { 1, 2 ,3, },
BinaryData = binary_data,
}

end)
Expand Down Expand Up @@ -164,6 +171,7 @@ describe("operations protocol", function()
Action = "AssumeRole",
Version = "2011-06-15",
nice = '',
BinaryData = binary_data,
}
}, request)
end)
Expand All @@ -182,7 +190,7 @@ describe("operations protocol", function()
assert.same({
headers = {
["X-Sooper-Secret"] = "towel",
["Content-Length"] = 152,
["Content-Length"] = 172,
["Content-Type"] = "application/x-amz-json-1.0",
["X-Amz-Target"] = "sts.AssumeRole",
["Host"] = "sts.amazonaws.com",
Expand All @@ -199,11 +207,12 @@ describe("operations protocol", function()
subList = { 1,2,3 },
RoleArn = "hello",
RoleSessionName = "world",
BinaryData = binary_data,
},
query = {
UserId = "Arthur Dent",
nice = '',
}
},
}, request)
end)

Expand All @@ -221,7 +230,7 @@ describe("operations protocol", function()
assert.same({
headers = {
["X-Sooper-Secret"] = "towel",
["Content-Length"] = 152,
["Content-Length"] = 172,
["Content-Type"] = "application/x-amz-json-1.0",
["X-Amz-Target"] = "sts.AssumeRole",
["Host"] = "sts.amazonaws.com",
Expand All @@ -238,6 +247,7 @@ describe("operations protocol", function()
subList = { 1,2,3 },
RoleArn = "hello",
RoleSessionName = "world",
BinaryData = binary_data,
},
query = {
UserId = "Arthur Dent",
Expand Down Expand Up @@ -280,7 +290,7 @@ describe("operations protocol", function()
assert.same({
headers = {
["X-Sooper-Secret"] = "towel",
["Content-Length"] = 424,
["Content-Length"] = 456,
["Content-Type"] = "application/xml",
["X-Amz-Target"] = "sts.AssumeRole",
["Host"] = "sts.amazonaws.com",
Expand All @@ -294,6 +304,8 @@ describe("operations protocol", function()
[1] = 'hello' },
RoleSessionName = {
[1] = 'world' },
BinaryData = {
[1] = binary_data },
attr = {
[1] = 'xmlns',
xmlns = 'cool-name-space' },
Expand Down

0 comments on commit b07928d

Please sign in to comment.