예제 #1
0
        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
예제 #2
0
        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
예제 #3
0
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)
예제 #4
0
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)