@@ -21,7 +21,7 @@ class RequestMock(BaseOpenAPIRequest):
2121 def __init__ (
2222 self , host_url , method , path , path_pattern = None , args = None ,
2323 view_args = None , headers = None , cookies = None , data = None ,
24- content_type = 'application/json' ):
24+ mimetype = 'application/json' ):
2525 self .host_url = host_url
2626 self .path = path
2727 self .path_pattern = path_pattern or path
@@ -33,7 +33,7 @@ def __init__(
3333 self .cookies = cookies or {}
3434 self .data = data or ''
3535
36- self .content_type = content_type
36+ self .mimetype = mimetype
3737
3838
3939class TestPetstore (object ):
@@ -89,12 +89,12 @@ def test_spec(self, spec, spec_dict):
8989 assert bool (operation .request_body .required ) == \
9090 request_body_spec .get ('required' , False )
9191
92- for content_type , media_type in iteritems (
92+ for mimetype , media_type in iteritems (
9393 operation .request_body .content ):
9494 assert type (media_type ) == MediaType
95- assert media_type .content_type == content_type
95+ assert media_type .mimetype == mimetype
9696
97- content_spec = request_body_spec ['content' ][content_type ]
97+ content_spec = request_body_spec ['content' ][mimetype ]
9898 schema_spec = content_spec .get ('schema' )
9999 assert bool (schema_spec ) == bool (media_type .schema )
100100
@@ -351,7 +351,7 @@ def test_get_pets_wrong_body_type(self, spec):
351351 with pytest .raises (InvalidValueType ):
352352 request .get_body (spec )
353353
354- def test_post_pets_raises_invalid_content_type (self , spec ):
354+ def test_post_pets_raises_invalid_mimetype (self , spec ):
355355 host_url = 'http://petstore.swagger.io/v1'
356356 path_pattern = '/v1/pets'
357357 data_json = {
@@ -362,7 +362,7 @@ def test_post_pets_raises_invalid_content_type(self, spec):
362362
363363 request = RequestMock (
364364 host_url , 'POST' , '/pets' ,
365- path_pattern = path_pattern , data = data , content_type = 'text/html' ,
365+ path_pattern = path_pattern , data = data , mimetype = 'text/html' ,
366366 )
367367
368368 parameters = request .get_parameters (spec )
@@ -383,7 +383,7 @@ def test_post_pets_raises_invalid_server_error(self, spec):
383383
384384 request = RequestMock (
385385 host_url , 'POST' , '/pets' ,
386- path_pattern = path_pattern , data = data , content_type = 'text/html' ,
386+ path_pattern = path_pattern , data = data , mimetype = 'text/html' ,
387387 )
388388
389389 with pytest .raises (InvalidServerError ):
0 commit comments