def setUp(self): NeoUnitTestBase.setUp(self) # create an application object config = self.getMasterConfiguration(master_number=1, replicas=1) self.app = Application(config) self.app.em.close() self.app.pt.clear() self.app.pt.setID(1) self.app.em = Mock() self.app.loid = '\0' * 8 self.app.tm.setLastTID('\0' * 8) self.service = ClientServiceHandler(self.app) # define some variable to simulate client and storage node self.client_port = 11022 self.storage_port = 10021 self.master_port = 10010 self.master_address = ('127.0.0.1', self.master_port) self.client_address = ('127.0.0.1', self.client_port) self.storage_address = ('127.0.0.1', self.storage_port) self.storage_uuid = self.getStorageUUID() # register the storage self.app.nm.createStorage( uuid=self.storage_uuid, address=self.storage_address, )
def setUp(self): NeoUnitTestBase.setUp(self) # create an application object config = self.getMasterConfiguration(master_number=1, replicas=1) self.app = Application(config) self.app.em.close() self.app.pt.clear() self.app.em = Mock() self.service = StorageServiceHandler(self.app) self.client_handler = ClientServiceHandler(self.app) # define some variable to simulate client and storage node self.client_port = 11022 self.storage_port = 10021 self.master_port = 10010 self.master_address = ('127.0.0.1', self.master_port) self.client_address = ('127.0.0.1', self.client_port) self.storage_address = ('127.0.0.1', self.storage_port)