#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# super ( APIExtraDataAccessHookTests , self ) . setUp ( ) #NEWLINE# self . resource_class = GenericTestResource #NEWLINE# self . resource = self . resource_class ( ) #NEWLINE# class DummyExtension ( Extension ) : #NEWLINE# #INDENT# resources = [ self . resource ] #NEWLINE# registration = RegisteredExtension ( ) #NEWLINE# #UNINDENT# self . extension_class = DummyExtension #NEWLINE# entry_point = Mock ( ) #NEWLINE# entry_point . load = ( lambda : self . extension_class ) #NEWLINE# entry_point . dist = Mock ( ) #NEWLINE# entry_point . dist . project_name = 'TestProjectName' #NEWLINE# entry_point . dist . get_metadata_lines = ( lambda * args : [ 'Name: Resource Test Extension' ] ) #NEWLINE# self . manager . _entrypoint_iterator = ( lambda : [ entry_point ] ) #NEWLINE# self . manager . load ( ) #NEWLINE# self . extension = self . manager . enable_extension ( entry_point . extension_class . id ) #NEWLINE# self . registered = True #NEWLINE# self . extension_class . info = ExtensionInfo ( entry_point , self . extension_class ) #NEWLINE# self . url = self . resource . get_item_url ( test_id = 1 ) #NEWLINE# self . resource . extra_data = { #NEWLINE# #INDENT# 'public' : 'foo' , #NEWLINE# 'private' : 'secret' , #NEWLINE# 'readonly' : 'bar' , #NEWLINE# #UNINDENT# }