1414 TransportServerError ,
1515)
1616
17- from .conftest import TemporaryFile
17+ from .conftest import TemporaryFile , strip_braces_spaces
1818
1919query1_str = """
2020 query getContinents {
@@ -588,15 +588,15 @@ def test_code():
588588
589589file_upload_mutation_1 = """
590590 mutation($file: Upload!) {
591- uploadFile(input:{ other_var:$other_var, file:$file }) {
591+ uploadFile(input:{other_var:$other_var, file:$file}) {
592592 success
593593 }
594594 }
595595"""
596596
597597file_upload_mutation_1_operations = (
598- '{"query": "mutation ($file: Upload!) {\\ n uploadFile(input: { other_var: '
599- '$other_var, file: $file }) {\\ n success\\ n }\\ n}", "variables": '
598+ '{"query": "mutation ($file: Upload!) {\\ n uploadFile(input: {other_var: '
599+ '$other_var, file: $file}) {\\ n success\\ n }\\ n}", "variables": '
600600 '{"file": null, "other_var": 42}}'
601601)
602602
@@ -617,7 +617,7 @@ async def single_upload_handler(request):
617617 field_0 = await reader .next ()
618618 assert field_0 .name == "operations"
619619 field_0_text = await field_0 .text ()
620- assert field_0_text == file_upload_mutation_1_operations
620+ assert strip_braces_spaces ( field_0_text ) == file_upload_mutation_1_operations
621621
622622 field_1 = await reader .next ()
623623 assert field_1 .name == "map"
@@ -679,7 +679,7 @@ async def single_upload_handler_with_content_type(request):
679679 field_0 = await reader .next ()
680680 assert field_0 .name == "operations"
681681 field_0_text = await field_0 .text ()
682- assert field_0_text == file_upload_mutation_1_operations
682+ assert strip_braces_spaces ( field_0_text ) == file_upload_mutation_1_operations
683683
684684 field_1 = await reader .next ()
685685 assert field_1 .name == "map"
@@ -790,7 +790,7 @@ async def binary_upload_handler(request):
790790 field_0 = await reader .next ()
791791 assert field_0 .name == "operations"
792792 field_0_text = await field_0 .text ()
793- assert field_0_text == file_upload_mutation_1_operations
793+ assert strip_braces_spaces ( field_0_text ) == file_upload_mutation_1_operations
794794
795795 field_1 = await reader .next ()
796796 assert field_1 .name == "map"
@@ -931,7 +931,7 @@ async def file_sender(file_name):
931931
932932file_upload_mutation_2_operations = (
933933 '{"query": "mutation ($file1: Upload!, $file2: Upload!) {\\ n '
934- 'uploadFile(input: { file1: $file, file2: $file }) {\\ n success\\ n }\\ n}", '
934+ 'uploadFile(input: {file1: $file, file2: $file}) {\\ n success\\ n }\\ n}", '
935935 '"variables": {"file1": null, "file2": null}}'
936936)
937937
@@ -955,7 +955,7 @@ async def handler(request):
955955 field_0 = await reader .next ()
956956 assert field_0 .name == "operations"
957957 field_0_text = await field_0 .text ()
958- assert field_0_text == file_upload_mutation_2_operations
958+ assert strip_braces_spaces ( field_0_text ) == file_upload_mutation_2_operations
959959
960960 field_1 = await reader .next ()
961961 assert field_1 .name == "map"
@@ -1019,15 +1019,15 @@ async def handler(request):
10191019
10201020file_upload_mutation_3 = """
10211021 mutation($files: [Upload!]!) {
1022- uploadFiles(input:{ files:$files }) {
1022+ uploadFiles(input:{files:$files}) {
10231023 success
10241024 }
10251025 }
10261026"""
10271027
10281028file_upload_mutation_3_operations = (
10291029 '{"query": "mutation ($files: [Upload!]!) {\\ n uploadFiles('
1030- "input: { files: $files })"
1030+ "input: {files: $files})"
10311031 ' {\\ n success\\ n }\\ n}", "variables": {"files": [null, null]}}'
10321032)
10331033
@@ -1046,7 +1046,7 @@ async def handler(request):
10461046 field_0 = await reader .next ()
10471047 assert field_0 .name == "operations"
10481048 field_0_text = await field_0 .text ()
1049- assert field_0_text == file_upload_mutation_3_operations
1049+ assert strip_braces_spaces ( field_0_text ) == file_upload_mutation_3_operations
10501050
10511051 field_1 = await reader .next ()
10521052 assert field_1 .name == "map"
0 commit comments