Beispiel #1
0
        def topic(self):
            conf = Config(MONGO_STORAGE_SERVER_PORT=7777)
            storage = MongoStorage(Context(config=conf))
            storage.put(IMAGE_URL % 14, IMAGE_BYTES)
            storage.put_detector_data(IMAGE_URL % 14, "some data")

            return storage.get_detector_data(IMAGE_URL % 14)
Beispiel #2
0
 def topic(self):
     storage = MongoStorage(
         Context(
             config=Config(MONGO_STORAGE_SERVER_PORT=7777,
                           STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True,
                           SECURITY_KEY='ACME-SEC')))
     return storage.get_crypto(IMAGE_URL % 7)
Beispiel #3
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)
Beispiel #4
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)
Beispiel #5
0
            def topic(self):
                storage = MongoStorage(
                    Context(
                        config=Config(MONGO_STORAGE_SERVER_PORT=7777,
                                      STORES_CRYPTO_KEY_FOR_EACH_IMAGE=False)))
                storage.put(IMAGE_URL % 3, IMAGE_BYTES)

                return COLLECTION.find_one({'path': IMAGE_URL % 3})
Beispiel #6
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)
Beispiel #7
0
            def topic(self):
                conf = Config(MONGO_STORAGE_SERVER_PORT=7777,
                              STORES_CRYPTO_KEY_FOR_EACH_IMAGE=False,
                              SECURITY_KEY='ACME-SEC')
                storage = MongoStorage(Context(config=conf))
                storage.put(IMAGE_URL % 12, IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % 12)

                item = storage.get_crypto(IMAGE_URL % 12)
                return item.result()
Beispiel #8
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)
                storage = MongoStorage(Context(config=config))
                storage.put(IMAGE_URL % 10, IMAGE_BYTES)

                item = storage.get(IMAGE_URL % 10)
                return item is None
Beispiel #9
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})
Beispiel #10
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()
Beispiel #11
0
 def topic(self):
     storage = MongoStorage(
         Context(config=Config(MONGO_STORAGE_SERVER_PORT=7777)))
     return storage.exists(IMAGE_URL % 20000)
Beispiel #12
0
 def topic(self):
     storage = MongoStorage(
         Context(config=Config(MONGO_STORAGE_SERVER_PORT=7777)))
     storage.put(IMAGE_URL % 1, IMAGE_BYTES)
     return COLLECTION.find_one({'path': IMAGE_URL % 1})
Beispiel #13
0
 def topic(self):
     storage = MongoStorage(
         Context(config=Config(MONGO_STORAGE_SERVER_PORT=7777)))
     storage.remove(IMAGE_URL % 9999)
     return self.parent.parent.collection.find_one(
         {'path': IMAGE_URL % 9999})
Beispiel #14
0
 def topic(self):
     conf = Config(MONGO_STORAGE_SERVER_PORT=7777,
                   STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
     server = get_server()
     storage = MongoStorage(Context(server=server, config=conf))
     storage.put(IMAGE_URL % 4, IMAGE_BYTES)
Beispiel #15
0
 def topic(self):
     storage = MongoStorage(
         Context(config=Config(MONGO_STORAGE_SERVER_PORT=7777)))
     storage.remove(IMAGE_URL % 9999)
     return COLLECTION.find_one({'path': IMAGE_URL % 9999})
Beispiel #16
0
 def topic(self):
     storage = MongoStorage(
         Context(config=Config(MONGO_STORAGE_SERVER_PORT=7777)))
     storage.put(IMAGE_URL % 2, IMAGE_BYTES)
     return storage.get(IMAGE_URL % 2)
Beispiel #17
0
 def topic(self):
     storage = MongoStorage(
         Context(config=Config(MONGO_STORAGE_SERVER_PORT=7777)))
     storage.put(IMAGE_URL % 1, IMAGE_BYTES)
     return self.parent.collection.find_one({'path': IMAGE_URL % 1})