@@ -46,14 +46,12 @@ def test_no_date_header(endpoint: Endpoint) -> None:
46
46
A `BAD_REQUEST` response is returned when no `Date` header is given.
47
47
"""
48
48
endpoint_headers = dict (endpoint .prepared_request .headers )
49
- content = endpoint .prepared_request .body or b""
50
- assert isinstance (content , bytes )
51
49
52
50
authorization_string = authorization_header (
53
51
access_key = endpoint .access_key ,
54
52
secret_key = endpoint .secret_key ,
55
- method = str ( endpoint .prepared_request .method ) ,
56
- content = content ,
53
+ method = endpoint .prepared_request .method or "" ,
54
+ content = endpoint . prepared_request . body ,
57
55
content_type = endpoint .auth_header_content_type ,
58
56
date = "" ,
59
57
request_path = endpoint .prepared_request .path_url ,
@@ -112,14 +110,12 @@ def test_incorrect_date_format(endpoint: Endpoint) -> None:
112
110
date_incorrect_format = now .strftime ("%a %b %d %H:%M:%S" )
113
111
114
112
endpoint_headers = dict (endpoint .prepared_request .headers )
115
- content = endpoint .prepared_request .body or b""
116
- assert isinstance (content , bytes )
117
113
118
114
authorization_string = authorization_header (
119
115
access_key = endpoint .access_key ,
120
116
secret_key = endpoint .secret_key ,
121
- method = str ( endpoint .prepared_request .method ) ,
122
- content = content ,
117
+ method = endpoint .prepared_request .method or "" ,
118
+ content = endpoint . prepared_request . body ,
123
119
content_type = endpoint .auth_header_content_type ,
124
120
date = date_incorrect_format ,
125
121
request_path = endpoint .prepared_request .path_url ,
@@ -185,14 +181,12 @@ def test_date_out_of_range_after(endpoint: Endpoint) -> None:
185
181
date = rfc_1123_date ()
186
182
187
183
endpoint_headers = dict (endpoint .prepared_request .headers )
188
- content = endpoint .prepared_request .body or b""
189
- assert isinstance (content , bytes )
190
184
191
185
authorization_string = authorization_header (
192
186
access_key = endpoint .access_key ,
193
187
secret_key = endpoint .secret_key ,
194
- method = str ( endpoint .prepared_request .method ) ,
195
- content = content ,
188
+ method = endpoint .prepared_request .method or "" ,
189
+ content = endpoint . prepared_request . body ,
196
190
content_type = endpoint .auth_header_content_type ,
197
191
date = date ,
198
192
request_path = endpoint .prepared_request .path_url ,
@@ -251,14 +245,12 @@ def test_date_out_of_range_before(endpoint: Endpoint) -> None:
251
245
date = rfc_1123_date ()
252
246
253
247
endpoint_headers = dict (endpoint .prepared_request .headers )
254
- content = endpoint .prepared_request .body or b""
255
- assert isinstance (content , bytes )
256
248
257
249
authorization_string = authorization_header (
258
250
access_key = endpoint .access_key ,
259
251
secret_key = endpoint .secret_key ,
260
- method = str ( endpoint .prepared_request .method ) ,
261
- content = content ,
252
+ method = endpoint .prepared_request .method or "" ,
253
+ content = endpoint . prepared_request . body ,
262
254
content_type = endpoint .auth_header_content_type ,
263
255
date = date ,
264
256
request_path = endpoint .prepared_request .path_url ,
@@ -316,14 +308,12 @@ def test_date_in_range_after(endpoint: Endpoint) -> None:
316
308
date = rfc_1123_date ()
317
309
318
310
endpoint_headers = dict (endpoint .prepared_request .headers )
319
- content = endpoint .prepared_request .body or b""
320
- assert isinstance (content , bytes )
321
311
322
312
authorization_string = authorization_header (
323
313
access_key = endpoint .access_key ,
324
314
secret_key = endpoint .secret_key ,
325
- method = str ( endpoint .prepared_request .method ) ,
326
- content = content ,
315
+ method = endpoint .prepared_request .method or "" ,
316
+ content = endpoint . prepared_request . body ,
327
317
content_type = endpoint .auth_header_content_type ,
328
318
date = date ,
329
319
request_path = endpoint .prepared_request .path_url ,
@@ -372,14 +362,12 @@ def test_date_in_range_before(endpoint: Endpoint) -> None:
372
362
date = rfc_1123_date ()
373
363
374
364
endpoint_headers = dict (endpoint .prepared_request .headers )
375
- content = endpoint .prepared_request .body or b""
376
- assert isinstance (content , bytes )
377
365
378
366
authorization_string = authorization_header (
379
367
access_key = endpoint .access_key ,
380
368
secret_key = endpoint .secret_key ,
381
- method = str ( endpoint .prepared_request .method ) ,
382
- content = content ,
369
+ method = endpoint .prepared_request .method or "" ,
370
+ content = endpoint . prepared_request . body ,
383
371
content_type = endpoint .auth_header_content_type ,
384
372
date = date ,
385
373
request_path = endpoint .prepared_request .path_url ,
0 commit comments