#NEWLINE# def test_possible_specify_simple_api( self ) : #NEWLINE# #INDENT# api = APISpecification ( version = '' , base_url = '' ) #NEWLINE# api . add_resource ( Resource ( 'comments' , paths = [ Path ( '/comments.{key}' , params = [ Param ( 'key' , default_value = 'json' , required = False , options = [ 'json' , 'js' , 'xml' ] ) ] , methods = [ Method ( 'GET' , errors = [ APIError ( code = 301 , description = '' ) , APIError ( code = 404 , description = '' ) ] ) , Method ( 'POST' , errors = [ APIError ( code = 301 , description = '' ) , APIError ( code = 404 , description = '' ) ] ) ] ) ] ) ) #NEWLINE# resource = api . resources [ 0 ] #NEWLINE# assert ( resource . paths [ 0 ] . name == '/comments.{key}' ) #NEWLINE# assert ( resource . paths [ 0 ] . params [ 0 ] . name == 'key' ) #NEWLINE# assert ( resource . paths [ 0 ] . params [ 0 ] . default_value == 'json' ) #NEWLINE# assert ( resource . paths [ 0 ] . params [ 0 ] . required == False ) #NEWLINE# assert ( resource . paths [ 0 ] . params [ 0 ] . options == [ 'json' , 'js' , 'xml' ] ) #NEWLINE# assert ( resource . paths [ 0 ] . methods [ 0 ] . name == 'GET' ) #NEWLINE# assert ( self . paths [ 0 ] . methods [ 1 ] . name == 'POST' )