19
19
20
20
21
21
@pytest .mark .asyncio
22
- async def test_execute_sends_post_to_correct_url_with_correct_payload (httpx_mock ):
22
+ async def test_execute_sends_post_to_correct_url_with_correct_payload (httpx_mock ) -> None :
23
23
httpx_mock .add_response ()
24
24
25
25
client = AsyncBaseClient (url = "http://base_url/endpoint" )
@@ -44,7 +44,7 @@ async def test_execute_sends_post_to_correct_url_with_correct_payload(httpx_mock
44
44
45
45
46
46
@pytest .mark .asyncio
47
- async def test_execute_parses_pydantic_variables_before_sending (httpx_mock ):
47
+ async def test_execute_parses_pydantic_variables_before_sending (httpx_mock ) -> None :
48
48
class TestModel1 (BaseModel ):
49
49
a : int
50
50
@@ -110,7 +110,7 @@ class TestModel1(BaseModel):
110
110
111
111
112
112
@pytest .mark .asyncio
113
- async def test_execute_sends_payload_without_unset_arguments (httpx_mock ):
113
+ async def test_execute_sends_payload_without_unset_arguments (httpx_mock ) -> None :
114
114
httpx_mock .add_response ()
115
115
client = AsyncBaseClient (url = "http://base_url" )
116
116
query_str = """
@@ -185,7 +185,7 @@ class TestInputA(BaseModel):
185
185
@pytest .mark .asyncio
186
186
async def test_execute_sends_payload_with_serialized_datetime_without_exception (
187
187
httpx_mock ,
188
- ):
188
+ ) -> None :
189
189
httpx_mock .add_response ()
190
190
client = AsyncBaseClient (url = "http://base_url" )
191
191
query_str = "query Abc($arg: DATETIME) { abc }"
@@ -212,7 +212,7 @@ async def test_execute_sends_request_with_correct_content_type(httpx_mock):
212
212
@pytest .mark .asyncio
213
213
async def test_execute_sends_request_with_extra_headers_and_correct_content_type (
214
214
httpx_mock ,
215
- ):
215
+ ) -> None :
216
216
httpx_mock .add_response ()
217
217
client = AsyncBaseClient (url = "http://base_url" , headers = {"h_key" : "h_value" })
218
218
@@ -224,7 +224,7 @@ async def test_execute_sends_request_with_extra_headers_and_correct_content_type
224
224
225
225
226
226
@pytest .mark .asyncio
227
- async def test_execute_passes_kwargs_to_json_post (mocker ):
227
+ async def test_execute_passes_kwargs_to_json_post (mocker ) -> None :
228
228
http_client = mocker .AsyncMock ()
229
229
230
230
await AsyncBaseClient (url = "http://base_url" , http_client = http_client ).execute (
@@ -236,7 +236,7 @@ async def test_execute_passes_kwargs_to_json_post(mocker):
236
236
237
237
238
238
@pytest .mark .asyncio
239
- async def test_execute_sends_json_request_with_headers_from_passed_kwargs (httpx_mock ):
239
+ async def test_execute_sends_json_request_with_headers_from_passed_kwargs (httpx_mock ) -> None :
240
240
httpx_mock .add_response ()
241
241
client = AsyncBaseClient (
242
242
url = "http://base_url" ,
@@ -263,7 +263,7 @@ async def test_execute_sends_json_request_with_headers_from_passed_kwargs(httpx_
263
263
@pytest .mark .asyncio
264
264
async def test_execute_sends_file_with_multipart_form_data_content_type (
265
265
httpx_mock , txt_file
266
- ):
266
+ ) -> None :
267
267
httpx_mock .add_response ()
268
268
269
269
client = AsyncBaseClient (url = "http://base_url" )
@@ -276,7 +276,7 @@ async def test_execute_sends_file_with_multipart_form_data_content_type(
276
276
277
277
278
278
@pytest .mark .asyncio
279
- async def test_execute_sends_file_as_multipart_request (httpx_mock , txt_file ):
279
+ async def test_execute_sends_file_as_multipart_request (httpx_mock , txt_file ) -> None :
280
280
httpx_mock .add_response ()
281
281
query_str = "query Abc($file: Upload!) { abc(file: $file) }"
282
282
@@ -307,7 +307,7 @@ async def test_execute_sends_file_as_multipart_request(httpx_mock, txt_file):
307
307
308
308
309
309
@pytest .mark .asyncio
310
- async def test_execute_sends_file_from_memory (httpx_mock , in_memory_txt_file ):
310
+ async def test_execute_sends_file_from_memory (httpx_mock , in_memory_txt_file ) -> None :
311
311
httpx_mock .add_response ()
312
312
query_str = "query Abc($file: Upload!) { abc(file: $file) }"
313
313
@@ -338,7 +338,7 @@ async def test_execute_sends_file_from_memory(httpx_mock, in_memory_txt_file):
338
338
339
339
340
340
@pytest .mark .asyncio
341
- async def test_execute_sends_multiple_files (httpx_mock , txt_file , png_file ):
341
+ async def test_execute_sends_multiple_files (httpx_mock , txt_file , png_file ) -> None :
342
342
httpx_mock .add_response ()
343
343
query_str = "query Abc($files: [Upload!]!) { abc(files: $files) }"
344
344
@@ -374,7 +374,7 @@ async def test_execute_sends_multiple_files(httpx_mock, txt_file, png_file):
374
374
375
375
376
376
@pytest .mark .asyncio
377
- async def test_execute_sends_nested_file (httpx_mock , txt_file ):
377
+ async def test_execute_sends_nested_file (httpx_mock , txt_file ) -> None :
378
378
class InputType (BaseModel ):
379
379
file_ : Any
380
380
@@ -408,7 +408,7 @@ class InputType(BaseModel):
408
408
409
409
410
410
@pytest .mark .asyncio
411
- async def test_execute_sends_each_file_only_once (httpx_mock , txt_file ):
411
+ async def test_execute_sends_each_file_only_once (httpx_mock , txt_file ) -> None :
412
412
httpx_mock .add_response ()
413
413
query_str = "query Abc($files: [Upload!]!) { abc(files: $files) }"
414
414
@@ -439,7 +439,7 @@ async def test_execute_sends_each_file_only_once(httpx_mock, txt_file):
439
439
440
440
441
441
@pytest .mark .asyncio
442
- async def test_execute_passes_kwargs_to_multipart_post (mocker , txt_file ):
442
+ async def test_execute_passes_kwargs_to_multipart_post (mocker , txt_file ) -> None :
443
443
http_client = mocker .AsyncMock ()
444
444
445
445
await AsyncBaseClient (url = "http://base_url" , http_client = http_client ).execute (
@@ -457,7 +457,7 @@ async def test_execute_passes_kwargs_to_multipart_post(mocker, txt_file):
457
457
@pytest .mark .asyncio
458
458
async def test_execute_sends_multipart_request_with_headers_from_passed_kwargs (
459
459
httpx_mock , txt_file
460
- ):
460
+ ) -> None :
461
461
httpx_mock .add_response ()
462
462
client = AsyncBaseClient (
463
463
url = "http://base_url" ,
@@ -494,7 +494,7 @@ async def test_execute_sends_multipart_request_with_headers_from_passed_kwargs(
494
494
)
495
495
def test_get_data_raises_graphql_client_http_error (
496
496
mocker , status_code , response_content
497
- ):
497
+ ) -> None :
498
498
client = AsyncBaseClient (url = "base_url" , http_client = mocker .MagicMock ())
499
499
response = httpx .Response (
500
500
status_code = status_code , content = json .dumps (response_content )
@@ -509,7 +509,7 @@ def test_get_data_raises_graphql_client_http_error(
509
509
@pytest .mark .parametrize ("response_content" , ["invalid_json" , {"not_data" : "" }, "" ])
510
510
def test_get_data_raises_graphql_client_invalid_response_error (
511
511
mocker , response_content
512
- ):
512
+ ) -> None :
513
513
client = AsyncBaseClient (url = "base_url" , http_client = mocker .MagicMock ())
514
514
response = httpx .Response (status_code = 200 , content = json .dumps (response_content ))
515
515
@@ -553,7 +553,7 @@ def test_get_data_raises_graphql_client_invalid_response_error(
553
553
},
554
554
],
555
555
)
556
- def test_get_data_raises_graphql_client_graphql_multi_error (mocker , response_content ):
556
+ def test_get_data_raises_graphql_client_graphql_multi_error (mocker , response_content ) -> None :
557
557
client = AsyncBaseClient (url = "base_url" , http_client = mocker .MagicMock ())
558
558
559
559
with pytest .raises (GraphQLClientGraphQLMultiError ):
@@ -566,7 +566,7 @@ def test_get_data_raises_graphql_client_graphql_multi_error(mocker, response_con
566
566
"response_content" ,
567
567
[{"errors" : [], "data" : {}}, {"errors" : None , "data" : {}}, {"data" : {}}],
568
568
)
569
- def test_get_data_doesnt_raise_exception (mocker , response_content ):
569
+ def test_get_data_doesnt_raise_exception (mocker , response_content ) -> None :
570
570
client = AsyncBaseClient (url = "base_url" , http_client = mocker .MagicMock ())
571
571
572
572
data = client .get_data (
@@ -577,7 +577,7 @@ def test_get_data_doesnt_raise_exception(mocker, response_content):
577
577
578
578
579
579
@pytest .mark .asyncio
580
- async def test_base_client_used_as_context_manager_closes_http_client (mocker ):
580
+ async def test_base_client_used_as_context_manager_closes_http_client (mocker ) -> None :
581
581
fake_client = mocker .AsyncMock ()
582
582
async with AsyncBaseClient (url = "base_url" , http_client = fake_client ) as base_client :
583
583
await base_client .execute ("" )
0 commit comments