def topic(self, storages): file_storage, crypto_storage, detector_storage = storages storage = MixedStorage(None, file_storage, crypto_storage, detector_storage) storage.put('path1', 'contents') storage.put_crypto('path1') return storage
def topic(self, storages): file_storage, crypto_storage, detector_storage = storages storage = MixedStorage(None, file_storage, crypto_storage, detector_storage) storage.put("path1", "contents") storage.put_crypto("path1") storage.put_detector_data("path1", "detector") return storage
class BaseMidexStorageTestCase(TestCase): def get_storages(self): return Storage('security-key'), Storage('security-key'), Storage('detector') def get_context(self, *args, **kwargs): context = super(BaseMidexStorageTestCase, self).get_context(*args, **kwargs) self.storage = MixedStorage(None, *self.get_storages()) self.storage.put('path1', 'contents') self.storage.put_crypto('path1') self.storage.put_detector_data('path1', 'detector') return context def get_server(self, *args, **kwargs): server = ServerParameters(8888, 'localhost', 'thumbor.conf', None, 'info', None) server.security_key = 'ACME-SEC' return server def get_importer(self, *args, **kwargs): return Importer(self.config)