#NEWLINE# def __new__( cls , name , bases , attrs ) : #NEWLINE# #INDENT# endpoints = attrs . get ( 'endpoints' , [ ] ) #NEWLINE# status_code_text = attrs . get ( 'status_code_text' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# for ( path , status , method , data ) in endpoints : #NEWLINE# #INDENT# if ( not path . startswith ( '/' ) ) : #NEWLINE# #INDENT# path = ( '/' + path ) #NEWLINE# #UNINDENT# status_text = status_code_text . get ( status , 'UNKNOWN' ) #NEWLINE# test = make_test ( path , status , method , data ) #NEWLINE# test . __name__ = name #NEWLINE# if data : #NEWLINE# #INDENT# test . __doc__ = ( '%s %s %r => %d %s' % ( method , path , data , status , status_text ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# test . __doc__ = ( '%s %s => %d %s' % ( method , status_code_text , status , status_text ) ) #NEWLINE# #UNINDENT# test_name = ( 'test_proofread_%s' % uuid . uuid4 ( ) . hex [ : 6 ] ) #NEWLINE# attrs [ test_name ] = test #NEWLINE# #UNINDENT# return super ( BuildTestCase , cls ) . __new__ ( cls , name , bases , attrs )