File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- from openapi_client .models import Operation , Parameter , Schema
1+ from openapi_client .models import (
2+ Operation ,
3+ Parameter ,
4+ Schema ,
5+ OpenAPI ,
6+ Components ,
7+ Reference ,
8+ )
29from openapi_client .functions .emit import emit_function
10+ from openapi_client .tests .emit import (
11+ get_dummy_value_for_schema ,
12+ get_stub_body ,
13+ emit_operation_test ,
14+ )
315
416
517def test_emit_function_formData_and_no_path_vars ():
@@ -22,14 +34,6 @@ def test_emit_function_formData_and_no_path_vars():
2234 assert func_node .name .value == "test_formData_op"
2335
2436
25- from openapi_client .tests .emit import (
26- get_dummy_value_for_schema ,
27- get_stub_body ,
28- emit_operation_test ,
29- )
30- from openapi_client .models import OpenAPI , Components , Reference
31-
32-
3337def test_get_dummy_value_for_file ():
3438 schema = Schema (type = "file" )
3539 val = get_dummy_value_for_schema (schema )
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ def schema_(self):
8484 operationId = "test_body_param_exception" , parameters = [BadParameter ()]
8585 )
8686 try :
87- func = emit_operation_test ("post" , "/test" , op )
87+ emit_operation_test ("post" , "/test" , op )
8888 except Exception :
8989 pass
9090
@@ -137,6 +137,6 @@ def schema_(self):
137137 operationId = "test_other_param_exception" , parameters = [BadParameter3 ()]
138138 )
139139 try :
140- func = emit_operation_test ("post" , "/test" , op )
140+ emit_operation_test ("post" , "/test" , op )
141141 except Exception :
142142 pass
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def test_openapi_parse_external_refs_pointer_exception():
2121 }
2222 p1 .write_text (json .dumps (spec ), encoding = "utf-8" )
2323 parsed = parse_openapi_json (p1 .read_text (encoding = "utf-8" ))
24- assert parsed .components .schemas ["MySchema" ].type == None
24+ assert parsed .components .schemas ["MySchema" ].type is None
2525 finally :
2626 if p1 .exists ():
2727 p1 .unlink ()
You can’t perform that action at this time.
0 commit comments