#NEWLINE# def test_parameter( self ) : #NEWLINE# #INDENT# ' Parameter -> Parameter\n        ' #NEWLINE# o = self . app . root . paths [ '/api/pet/{petId}' ] . patch #NEWLINE# p = [ p for p in o . parameters if ( getattr ( p , 'in' ) == 'body' ) ] [ 0 ] #NEWLINE# self . assertEqual ( getattr ( p , 'in' ) , 'body' ) #NEWLINE# self . assertEqual ( p . required , True ) #NEWLINE# self . assertEqual ( getattr ( p . schema , '$ref' ) , _pf ( '/definitions/pet!##!Pet' ) ) #NEWLINE# o = self . app . root . paths [ '/api/pet/uploadImage' ] . post #NEWLINE# p = [ p for p in o . parameters if ( ( getattr ( p , 'in' ) == 'formData' ) and ( p . type == 'string' ) ) ] [ 0 ] #NEWLINE# self . assertEqual ( p . name , 'additionalMetadata' ) #NEWLINE# self . assertEqual ( p . required , False ) #NEWLINE# o = o . app . root . paths [ '/api/pet/uploadImage' ] . post #NEWLINE# p = [ p for p in o . parameters if ( ( getattr ( p , 'in' ) == 'formData' ) and ( p . type == 'file' ) ) ] [ 0 ] #NEWLINE# self . assertEqual ( p . name , 'file' ) #NEWLINE# self . assertEqual ( p . required , False ) #NEWLINE# try : #NEWLINE# #INDENT# SwaggerApp . _create_ ( get_test_data_folder ( version = '1.2' , which = 'upgrade_parameter' ) ) #NEWLINE# #UNINDENT# except errs . SchemaError as e : #NEWLINE# #INDENT# self . failUnlessEqual ( e . args , ( "Can't have $ref in non-body Parameters" , ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fail ( 'SchemaError not raised' )