Example #1
0
            def topic(self):
                conf = Config(MONGO_STORAGE_SERVER_PORT=7777, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                server = get_server('ACME-SEC')
                storage = MongoStorage(Context(config=conf, server=server))
                storage.put(IMAGE_URL % 6, IMAGE_BYTES)

                return storage.get_crypto(IMAGE_URL % 6)
Example #2
0
    def topic(self):
      self.conn = S3Connection()
      self.conn.create_bucket(s3_bucket)

      config=Config(STORAGE_BUCKET=s3_bucket)
      storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
      return storage.exists(IMAGE_URL % '9999')
Example #3
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,
                            HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(
                Context(config=config, server=get_server('ACME-SEC')))

            return storage.exists(IMAGE_URL % '9999')
Example #4
0
 def topic(self):
     config = Config(REDIS_STORAGE_SERVER_PORT=6668,
                     REDIS_STORAGE_SERVER_PASSWORD='******',
                     STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
     storage = RedisStorage(
         Context(config=config, server=get_server('ACME-SEC')))
     return storage.get_crypto(IMAGE_URL % 9999)
Example #5
0
 def topic(self):
     config = Config(
         REDIS_STORAGE_SERVER_PORT=6668, REDIS_STORAGE_SERVER_PASSWORD='******',
         STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True
     )
     storage = RedisStorage(Context(config=config, server=get_server('ACME-SEC')))
     return storage.get_crypto(IMAGE_URL % 9999)
Example #6
0
 def topic(self):
     config = Config(
         FILE_STORAGE_ROOT_PATH="/tmp/thumbor/file_storage/",
         STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
     storage = FileStorage(
         Context(config=config, server=get_server('ACME-SEC')))
     return storage.get_crypto(IMAGE_URL % 9999)
Example #7
0
        def topic(self,callback ):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,HBASE_STORAGE_SERVER_PORT=9090)
            context = Context(config=config, server=get_server('ACME-SEC'))
            storage = Storage(context)

            storage.put(IMAGE_URL % '1', IMAGE_BYTES)
            return loader.load(context, IMAGE_URL % '1', callback)
Example #8
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,
                            HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(
                Context(config=config, server=get_server('ACME-SEC')))

            return storage.resolve_original_photo_path("toto")
Example #9
0
            def topic(self, callback):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                storage.get_detector_data(IMAGE_URL % '9999', callback=callback)
Example #10
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.parent.table,
                     HBASE_STORAGE_SERVER_PORT=9090,
                     STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
     storage = Storage(
         Context(config=config, server=get_server('ACME-SEC')))
     return storage.get_crypto(IMAGE_URL % '9999')
Example #11
0
 def topic(self):
     config = Config(REDIS_STORAGE_SERVER_PORT=6668,
                     REDIS_STORAGE_SERVER_PASSWORD='******')
     storage = RedisStorage(
         Context(config=config, server=get_server('ACME-SEC')))
     storage.put(IMAGE_URL % 1, IMAGE_BYTES)
     return self.parent.connection.get(IMAGE_URL % 1)
Example #12
0
            def topic(self, callback):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                storage.get_detector_data(IMAGE_URL % '9999', callback=callback)
Example #13
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            return storage.exists(IMAGE_URL % '9999')
Example #14
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                return storage.get_crypto(IMAGE_URL % '9999')
Example #15
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(
                Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '5', IMAGE_BYTES)  # 1: we put the image

            def check_created(created):
                expect(created).to_equal(True)  # 2.1: assertion...

                def once_removed(rm):
                    def check_created_2(exists):
                        expect(exists).to_equal(True)  # 4.1: assertion...

                        storage.put(IMAGE_URL % '5')  # 5: we re-put it
                        storage.exists(IMAGE_URL % '5', callback=callback
                                       )  #6: we check its existance again

                    storage.exists(IMAGE_URL % '5', callback=check_created_2
                                   )  #4: we check if the image exists

                storage.remove(IMAGE_URL % '5',
                               callback=once_removed)  # 3: we delete it

            storage.exists(IMAGE_URL % '5',
                           callback=check_created)  # 2: we check it exists
Example #16
0
 def topic(self):
     config = Config(REDIS_STORAGE_SERVER_PORT=6668,
                     REDIS_STORAGE_SERVER_PASSWORD='******')
     storage = RedisStorage(
         Context(config=config, server=get_server('ACME-SEC')))
     storage.put(IMAGE_URL % 9999, IMAGE_BYTES)
     return storage.exists(IMAGE_URL % 9999)
Example #17
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            return storage.resolve_original_photo_path("toto")
Example #18
0
 def topic(self):
     config = Config(HBASE_STORAGE_SERVER_HOST='dummyserver',
                     HBASE_STORAGE_TABLE=self.parent.table,
                     HBASE_STORAGE_SERVER_PORT=9090,
                     SECURITY_KEY='ACME-SEC')
     storage = Storage(
         Context(config=config, server=get_server('ACME-SEC')))
Example #19
0
 def topic(self):
     config = Config(
         FILE_STORAGE_ROOT_PATH="/tmp/thumbor/file_storage/")
     storage = FileStorage(
         Context(config=config, server=get_server('ACME-SEC')))
     storage.put(IMAGE_URL % 1, IMAGE_BYTES)
     return storage.get(IMAGE_URL % 1)
Example #20
0
    def topic(self):
      self.conn = S3Connection()
      self.conn.create_bucket(s3_bucket)

      config=Config(STORAGE_BUCKET=s3_bucket)
      storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
      return storage.resolve_original_photo_path("toto")
Example #21
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
                return storage.get_detector_data(IMAGE_URL % "9999")
Example #22
0
            def topic(self):
                config = Config(FILE_STORAGE_ROOT_PATH="/tmp/thumbor/file_storage/", STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = FileStorage(Context(config=config, server=get_server('ACME-SEC')))

                storage.put(IMAGE_URL % 6, IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % 6)
                return storage.get_crypto(IMAGE_URL % 6)
Example #23
0
 def topic(self):
     config = Config(
         REDIS_STORAGE_SERVER_PORT=6668, REDIS_STORAGE_SERVER_PASSWORD='******',
         STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
     storage = RedisStorage(Context(config=config, server=get_server('')))
     storage.put(IMAGE_URL % 3, IMAGE_BYTES)
     storage.put_crypto(IMAGE_URL % 3)
Example #24
0
 def topic(self):
   config = Config(RIAK_STORAGE_BASEURL=self.parent.baseurl)
   storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
   storage.put(IMAGE_URL % '9', IMAGE_BYTES)
   created = storage.exists(IMAGE_URL % '9')
   storage.remove(IMAGE_URL % '9')
   return storage.exists(IMAGE_URL % '9') != created
Example #25
0
            def topic(self):
                config = Config(HBASE_STORAGE_TABLE=self.parent.parent.table,HBASE_STORAGE_SERVER_PORT=9090, SECURITY_KEY='ACME-SEC', STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))

                storage.put(IMAGE_URL % '6', IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % '6')
                return storage.get_crypto(IMAGE_URL % '6')
Example #26
0
      def topic(self):
        self.conn = S3Connection()
        self.conn.create_bucket(s3_bucket)

        config=Config(STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
        storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
        return storage.get_crypto(IMAGE_URL % '9999')
Example #27
0
        def topic(self):
            self.conn = S3Connection()
            bucket = self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket, STORAGE_AWS_STORAGE_ROOT_PATH="tata")
            storage = Storage(Context(config=config, server=get_server("ACME-SEC")))

            return storage.normalize_path("toto")
Example #28
0
            def topic(self):
                conf = Config(MONGO_STORAGE_SERVER_PORT=7777, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=False)
                server = get_server('')
                storage = MongoStorage(Context(config=conf, server=server))
                storage.put(IMAGE_URL % 13, IMAGE_BYTES)

                conf.STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True
                storage.put_crypto(IMAGE_URL % 13)
Example #29
0
 def topic(self):
     config = Config(
         HBASE_STORAGE_TABLE=self.parent.parent.table,
         HBASE_STORAGE_SERVER_PORT=9090,
         STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True,
     )
     storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
     return storage.get_crypto(IMAGE_URL % "9999")
Example #30
0
            def topic(self):
                conf = Config(MONGO_STORAGE_SERVER_PORT=7777, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)

                storage = MongoStorage(Context(config=conf, server=get_server("ACME-SEC")))

                storage.put(IMAGE_URL % 5, IMAGE_BYTES)

                return COLLECTION.find_one({"path": IMAGE_URL % 5})
Example #31
0
 def topic(self):
     conf = Config(MONGO_STORAGE_SERVER_PORT=7777,
                   STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True,
                   STORAGE_EXPIRATION_SECONDS=5000)
     server = get_server('ACME-SEC')
     storage = MongoStorage(Context(server=server, config=conf))
     storage.put(IMAGE_URL % 8, IMAGE_BYTES)
     return storage.get(IMAGE_URL % 8)
Example #32
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '3', IMAGE_BYTES)
            storage.exists(IMAGE_URL % '3', callback=callback)
Example #33
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket, STORAGE_AWS_STORAGE_ROOT_PATH='tata')
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))

            return storage.normalize_path('toto')
Example #34
0
 def topic(self):
     config = Config(REDIS_STORAGE_SERVER_PORT=6668,
                     REDIS_STORAGE_SERVER_PASSWORD='******',
                     STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
     storage = RedisStorage(
         Context(config=config, server=get_server('')))
     storage.put(IMAGE_URL % 3, IMAGE_BYTES)
     storage.put_crypto(IMAGE_URL % 3)
Example #35
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
            storage.put(IMAGE_URL % "3", IMAGE_BYTES)
            return storage.exists(IMAGE_URL % "3")
Example #36
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = Storage(Context(config=config, server=get_server('')))
                storage.put(IMAGE_URL % '9999', IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % '9999')
Example #37
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '3', IMAGE_BYTES)
            storage.exists(IMAGE_URL % '3', callback=callback)
Example #38
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.parent.table,
                     HBASE_STORAGE_SERVER_PORT=9090)
     storage = Storage(
         Context(config=config, server=get_server('ACME-SEC')))
     storage.put(IMAGE_URL % '7', IMAGE_BYTES)
     storage.put_detector_data(IMAGE_URL % '7', 'some-data')
     return storage.get_detector_data(IMAGE_URL % '7')
Example #39
0
 def topic(self):
     config = Config(
         FILE_STORAGE_ROOT_PATH="/tmp/thumbor/file_storage/",
         STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
     storage = FileStorage(
         Context(config=config, server=get_server('')))
     storage.put(IMAGE_URL % 3, IMAGE_BYTES)
     storage.put_crypto(IMAGE_URL % 3)
Example #40
0
 def topic(self):
     config = Config(
         HBASE_STORAGE_SERVER_HOST="dummyserver",
         HBASE_STORAGE_TABLE=self.parent.table,
         HBASE_STORAGE_SERVER_PORT=9090,
         SECURITY_KEY="ACME-SEC",
     )
     storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
Example #41
0
 def topic(self):
     config = Config(
         FILE_STORAGE_ROOT_PATH="/tmp/thumbor/file_storage/%s" %
         random.randint(1, 10000000))
     storage = FileStorage(
         Context(config=config, server=get_server('ACME-SEC')))
     storage.ensure_dir(config.FILE_STORAGE_ROOT_PATH)
     return exists(config.FILE_STORAGE_ROOT_PATH)
Example #42
0
            def topic(self):
                conf = Config(MONGO_STORAGE_SERVER_PORT=7777,
                              STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                server = get_server('ACME-SEC')
                storage = MongoStorage(Context(config=conf, server=server))
                storage.put(IMAGE_URL % 6, IMAGE_BYTES)

                return storage.get_crypto(IMAGE_URL % 6)
Example #43
0
 def topic(self):
     config = Config(REDIS_STORAGE_SERVER_PORT=7778,
                     REDIS_STORAGE_SERVER_PASSWORD='******')
     storage = RedisStorage(
         Context(config=config, server=get_server('ACME-SEC')))
     storage.put(IMAGE_URL % 5, IMAGE_BYTES)
     storage.put_crypto(IMAGE_URL % 5)
     return storage.get_crypto(IMAGE_URL % 5)
Example #44
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket, TC_AWS_STORAGE_ROOT_PATH='tata')
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))

            return storage._normalize_path('toto')
Example #45
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = Storage(Context(config=config, server=get_server('')))
                storage.put(IMAGE_URL % '9999', IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % '9999')
Example #46
0
 def topic(self):
     config = Config(REDIS_STORAGE_SERVER_PORT=6668,
                     REDIS_STORAGE_SERVER_PASSWORD='******')
     storage = RedisStorage(
         Context(config=config, server=get_server('ACME-SEC')))
     storage.put(IMAGE_URL % 7, IMAGE_BYTES)
     storage.put_detector_data(IMAGE_URL % 7, 'some-data')
     return storage.get_detector_data(IMAGE_URL % 7)
Example #47
0
        def topic(self, callback):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,
                            HBASE_STORAGE_SERVER_PORT=9090)
            context = Context(config=config, server=get_server('ACME-SEC'))
            storage = Storage(context)

            storage.put(IMAGE_URL % '1', IMAGE_BYTES)
            return loader.load(context, IMAGE_URL % '1', callback)
Example #48
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))

            storage.put(IMAGE_URL % '9', IMAGE_BYTES)
            created = storage.exists(IMAGE_URL % '9')
            storage.remove(IMAGE_URL % '9')
            return storage.exists(IMAGE_URL % '9') != created
Example #49
0
 def topic(self):
     config = Config(
         HBASE_STORAGE_TABLE=self.parent.table, HBASE_STORAGE_SERVER_PORT=9090, SECURITY_KEY="ACME-SEC"
     )
     storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
     return (
         storage.put(IMAGE_URL % "àé", IMAGE_BYTES),
         self.parent.connection.get(self.parent.table, IMAGE_URL % "àé", self.parent.family),
     )
Example #50
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '4', IMAGE_BYTES)   # 1: we put the image
            storage.remove(IMAGE_URL % '4') # 2: we delete it
            storage.exists(IMAGE_URL % '4', callback=callback) # 3: we check it exists
Example #51
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.parent.table,
                     HBASE_STORAGE_SERVER_PORT=9090,
                     SECURITY_KEY='',
                     STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
     storage = Storage(Context(config=config,
                               server=get_server('')))
     storage.put(IMAGE_URL % '3', IMAGE_BYTES)
     storage.put_crypto(IMAGE_URL % '3')
Example #52
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                storage.put(IMAGE_URL % '9998', IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % '9998')
                return storage.get_crypto(IMAGE_URL % '9998')
Example #53
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                storage.put(IMAGE_URL % '7', IMAGE_BYTES)
                storage.put_detector_data(IMAGE_URL % '7', 'some-data')
                return storage.get_detector_data(IMAGE_URL % '7')
Example #54
0
            def topic(self):
                config = Config(REDIS_STORAGE_SERVER_PORT=300,
                                REDIS_STORAGE_SERVER_PASSWORD='******',
                                REDIS_STORAGE_IGNORE_ERRORS=True)
                storage = RedisStorage(context=Context(
                    config=config, server=get_server('ACME-SEC')),
                                       shared_client=False)

                return storage
Example #55
0
 def topic(self):
     conf = Config(
         MONGO_STORAGE_SERVER_PORT=7777, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True,
         STORAGE_EXPIRATION_SECONDS=5000
     )
     server = get_server('ACME-SEC')
     storage = MongoStorage(Context(server=server, config=conf))
     storage.put(IMAGE_URL % 8, IMAGE_BYTES)
     return storage.get(IMAGE_URL % 8)
Example #56
0
      def topic(self):
        self.conn = S3Connection()
        self.conn.create_bucket(s3_bucket)

        config=Config(STORAGE_BUCKET=s3_bucket)
        storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
        storage.put(IMAGE_URL % '7', IMAGE_BYTES)
        storage.put_detector_data(IMAGE_URL % '7', 'some-data')
        return storage.get_detector_data(IMAGE_URL % '7')
Example #57
0
      def topic(self):
        self.conn = S3Connection()
        self.conn.create_bucket(s3_bucket)

        config=Config(STORAGE_BUCKET=s3_bucket)
        storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
        storage.put(IMAGE_URL % '9998', IMAGE_BYTES)
        storage.put_crypto(IMAGE_URL % '9998')
        return storage.get_crypto(IMAGE_URL % '9998')
Example #58
0
 def topic(self):
     config = Config(
         HBASE_STORAGE_TABLE=self.parent.parent.table,
         HBASE_STORAGE_SERVER_PORT=9090,
         SECURITY_KEY="",
         STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True,
     )
     storage = Storage(Context(config=config, server=get_server("")))
     storage.put(IMAGE_URL % "3", IMAGE_BYTES)
     storage.put_crypto(IMAGE_URL % "3")
Example #59
0
            def topic(self):
                conf = Config(MONGO_STORAGE_SERVER_PORT=7777, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=False)
                server = get_server('ACME-SEC')
                storage = MongoStorage(Context(config=conf, server=server))
                storage.put(IMAGE_URL % 11, IMAGE_BYTES)

                conf.STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True
                storage.put_crypto(IMAGE_URL % 11)

                item = storage.get_crypto(IMAGE_URL % 11)
                return item.result()
Example #60
0
            def topic(self):
                config = Config(
                    MONGO_STORAGE_SERVER_PORT=7777, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True,
                    SECURITY_KEY='ACME-SEC', STORAGE_EXPIRATION_SECONDS=0
                )
                server = get_server('ACME-SEC')
                storage = MongoStorage(Context(server=server, config=config))
                storage.put(IMAGE_URL % 10, IMAGE_BYTES)

                item = storage.get(IMAGE_URL % 10)
                return item is None