コード例 #1
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
コード例 #2
0
ファイル: storage_vows.py プロジェクト: voxmedia/aws
        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)
コード例 #3
0
ファイル: storage_vows.py プロジェクト: voxmedia/aws
            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')
コード例 #4
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')
コード例 #5
0
ファイル: storage_vows.py プロジェクト: pgr0ss/aws
        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 % '2', IMAGE_BYTES)
            return storage.get(IMAGE_URL % '2')
コード例 #6
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('')))
                storage.put(IMAGE_URL % '9999', IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % '9999')
コード例 #7
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 % '2', IMAGE_BYTES)
            storage.get(IMAGE_URL % '2', callback=callback)
コード例 #8
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')
コード例 #9
0
ファイル: storage_vows.py プロジェクト: andrew-a-dev/aws
            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")
コード例 #10
0
ファイル: storage_vows.py プロジェクト: andrew-a-dev/aws
            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")))
                storage.put(IMAGE_URL % "6", IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % "6")
                return storage.get_crypto(IMAGE_URL % "6")
コード例 #11
0
            def topic(self, callback):
                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('ACME-SEC')))
                storage.put(IMAGE_URL % '6', IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % '6')
                storage.get_crypto(IMAGE_URL % '6', callback=callback)
コード例 #12
0
ファイル: storage_vows.py プロジェクト: thumbor-community/aws
        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
コード例 #13
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
コード例 #14
0
ファイル: storage_vows.py プロジェクト: pgr0ss/aws
        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 % '4', IMAGE_BYTES)
            created = storage.exists(IMAGE_URL % '4')
            time.sleep(1)
            storage.remove(IMAGE_URL % '4')
            time.sleep(1)
            return storage.exists(IMAGE_URL % '4') != created
コード例 #15
0
ファイル: storage_vows.py プロジェクト: voxmedia/aws
        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

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

                def once_removed(rm):
                    storage.exists(IMAGE_URL % '4', callback=callback) #4: we check if the image exists

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

            storage.exists(IMAGE_URL % '4', callback=check_created) # 2: we check it exists
コード例 #16
0
        def topic(self):
            self.conn = S3Connection()
            bucket = self.conn.create_bucket(s3_bucket)

            thumborId = IMAGE_URL % '1'
            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            store = storage.put(thumborId, IMAGE_BYTES)
            k = Key(bucket)
            k.key = thumborId
            result = k.get_contents_as_string()
            return (store, result)