Skip to content

Commit

Permalink
adds test for white spaces in xml string value
Browse files Browse the repository at this point in the history
  • Loading branch information
skotambkar authored and JordonPhillips committed Aug 17, 2020
1 parent f0b5a2c commit b455770
Showing 1 changed file with 65 additions and 2 deletions.
67 changes: 65 additions & 2 deletions smithy-aws-protocol-tests/model/restXml/document-structs.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,49 @@ apply SimpleScalarProperties @httpRequestTests([
floatValue: 5.5,
doubleValue: 6.5,
}
}
},
{
id: "SimpleScalarPropertiesWithEscapedCharacter",
documentation: "Serializes string with escaping",
protocol: restXml,
method: "PUT",
uri: "/SimpleScalarProperties",
body: """
<SimpleScalarPropertiesInputOutput>
<stringValue>&lt;string&gt;</stringValue>
</SimpleScalarPropertiesInputOutput>
""",
bodyMediaType: "application/xml",
headers: {
"Content-Type": "application/xml",
"X-Foo": "Foo",
},
params: {
foo: "Foo",
stringValue: "<string>",
}
},
{
id: "SimpleScalarPropertiesWithWhiteSpace",
documentation: "Serializes string containing white space",
protocol: restXml,
method: "PUT",
uri: "/SimpleScalarProperties",
body: """
<SimpleScalarPropertiesInputOutput>
<stringValue>string with white space</stringValue>
</SimpleScalarPropertiesInputOutput>
""",
bodyMediaType: "application/xml",
headers: {
"Content-Type": "application/xml",
"X-Foo": "Foo",
},
params: {
foo: "Foo",
stringValue: "string with white space",
}
},
])

apply SimpleScalarProperties @httpResponseTests([
Expand Down Expand Up @@ -101,7 +143,7 @@ apply SimpleScalarProperties @httpResponseTests([
},
{
id: "SimpleScalarPropertiesWithEscapedCharacter",
documentation: "Serializes escaped string",
documentation: "Serializes string with escaping",
protocol: restXml,
code: 200,
body: """
Expand Down Expand Up @@ -141,6 +183,27 @@ apply SimpleScalarProperties @httpResponseTests([
foo: "Foo",
stringValue: "string",
}
},
{
id: "SimpleScalarPropertiesWithWhiteSpace",
documentation: "Serializes string containing white space",
protocol: restXml,
code: 200,
body: """
<?xml version = "1.0" encoding = "UTF-8"?>
<SimpleScalarPropertiesInputOutput>
<stringValue>string with white space</stringValue>
</SimpleScalarPropertiesInputOutput>
""",
bodyMediaType: "application/xml",
headers: {
"Content-Type": "application/xml",
"X-Foo": "Foo",
},
params: {
foo: "Foo",
stringValue: "string with white space",
}
}
])

Expand Down

0 comments on commit b455770

Please sign in to comment.