Skip to content

Commit 17eb3b2

Browse files
committed
fix serialize tests
1 parent 4cc6a07 commit 17eb3b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/smithy-http/tests/unit/test_serializers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from smithy_http.deserializers import HTTPResponseDeserializer
4545
from smithy_json import JSONCodec
4646
from smithy_http.aio import HTTPResponse as _HTTPResponse
47-
from smithy_http import tuples_to_fields, Fields
47+
from smithy_http import tuples_to_fields, Field, Fields
4848
from smithy_http.serializers import HTTPRequestSerializer, HTTPResponseSerializer
4949

5050
# TODO: empty header prefix, query map
@@ -1604,6 +1604,8 @@ def async_streaming_payload_cases() -> list[HTTPMessageTestCase]:
16041604
+ async_streaming_payload_cases()
16051605
)
16061606

1607+
CONTENT_TYPE_FIELD = Field(name="content-type", values=["application/json"])
1608+
16071609

16081610
@pytest.mark.parametrize("case", REQUEST_SER_CASES)
16091611
async def test_serialize_http_request(case: HTTPMessageTestCase) -> None:
@@ -1623,6 +1625,8 @@ async def test_serialize_http_request(case: HTTPMessageTestCase) -> None:
16231625
actual_query = actual.destination.query or ""
16241626
expected_query = case.request.destination.query or ""
16251627
assert actual_query == expected_query
1628+
# set the content-type field here, otherwise cases would have to duplicate it everywhere
1629+
expected.fields.set_field(CONTENT_TYPE_FIELD)
16261630
assert actual.fields == expected.fields
16271631

16281632
if case.request.body:

0 commit comments

Comments
 (0)