<s> from six import add_metaclass <EOL> from nailgun . test . base import BaseIntegrationTest <EOL> from nailgun . utils import reverse <EOL> class BaseTestRemovedResources ( BaseIntegrationTest ) : <EOL> def assert_resp_correct ( self , resp ) : <EOL> self . assertEqual ( resp . status_code , <NUM_LIT> ) <EOL> self . assertEqual ( resp . json_body [ "<STR_LIT:message>" ] , self . message ) <EOL> def setUp ( self ) : <EOL> super ( BaseTestRemovedResources , self ) . setUp ( ) <EOL> self . message = u"<STR_LIT>" <EOL> self . kwargs = { <EOL> '<STR_LIT>' : self . default_headers , <EOL> '<STR_LIT>' : { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:m>' : <NUM_LIT:5> } , <EOL> '<STR_LIT>' : True <EOL> } <EOL> class BaseTestDataProviderMeta ( type ) : <EOL> def __new__ ( meta , classname , bases , class_dict ) : <EOL> def create_test_method ( handler , method ) : <EOL> def test_method ( self ) : <EOL> if method == '<STR_LIT>' : <EOL> self . kwargs . pop ( '<STR_LIT>' ) <EOL> r = getattr ( self . app , method ) ( handler , ** self . kwargs ) <EOL> self . assert_resp_correct ( r ) <EOL> return test_method <EOL> for handler in meta . handlers : <EOL> for method in meta . methods : <EOL> suffix = handler . strip ( '<STR_LIT:/>' ) . lower ( ) . replace ( '<STR_LIT:/>' , '<STR_LIT:_>' ) <EOL> name = '<STR_LIT>' . format ( method , suffix ) <EOL> class_dict [ name ] = create_test_method ( handler , method ) <EOL> return type . __new__ ( meta , classname , bases , class_dict ) <EOL> class RemovedResourcesMeta ( BaseTestDataProviderMeta ) : <EOL> handlers = ( <EOL> reverse ( '<STR_LIT>' ) , <EOL> reverse ( '<STR_LIT>' ) <EOL> ) <EOL> methods = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> @ add_metaclass ( RemovedResourcesMeta ) <EOL> class TestRemovedResources ( BaseTestRemovedResources ) : <EOL> pass <EOL> class RemovedIn51HandlerMeta ( BaseTestDataProviderMeta ) : <EOL> handlers = ( '<STR_LIT>' , ) <EOL> methods = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) </s>
