File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -383,13 +383,14 @@ def test_add_body_happy(self, mocker):
383
383
assert endpoint .form_body_class == form_body_class
384
384
assert endpoint .multipart_body == multipart_body
385
385
386
- def test__add_responses_status_code_error (self , mocker ):
386
+ @pytest .mark .parametrize ("response_status_code" , ["not_a_number" , 499 ])
387
+ def test__add_responses_status_code_error (self , response_status_code , mocker ):
387
388
from openapi_python_client .parser .openapi import Endpoint , Schemas
388
389
389
390
schemas = Schemas ()
390
391
response_1_data = mocker .MagicMock ()
391
392
data = {
392
- "not_a_number" : response_1_data ,
393
+ response_status_code : response_1_data ,
393
394
}
394
395
endpoint = self .make_endpoint ()
395
396
parse_error = ParseError (data = mocker .MagicMock ())
@@ -400,7 +401,7 @@ def test__add_responses_status_code_error(self, mocker):
400
401
401
402
assert response .errors == [
402
403
ParseError (
403
- detail = f"Invalid response status code not_a_number (not a number ), response will be ommitted from generated client"
404
+ detail = f"Invalid response status code { response_status_code } (not a valid HTTP status code ), response will be ommitted from generated client"
404
405
)
405
406
]
406
407
response_from_data .assert_not_called ()
You can’t perform that action at this time.
0 commit comments