コード例 #1
0
ファイル: test_s3.py プロジェクト: alexissmirnov/donomo
    def test_upload_from_stream(self):

        s3.initialize()

        s3_path = 'test-directory/test_002_upload_from_stream.txt'

        s3.upload_from_stream(s3_path, StringIO(self.content),
                              self.content_type)

        self._validate_and_remove_upload(s3_path)
コード例 #2
0
    def test_upload_from_stream(self):

        s3.initialize()

        s3_path = 'test-directory/test_002_upload_from_stream.txt'

        s3.upload_from_stream(
            s3_path,
            StringIO(self.content),
            self.content_type )

        self._validate_and_remove_upload( s3_path )
コード例 #3
0
ファイル: test_s3.py プロジェクト: alexissmirnov/donomo
    def test_upload_from_file(self):

        s3.initialize()

        s3_path = 'test-directory/test_002_upload_from_file.txt'

        file_descriptor, local_path = tempfile.mkstemp(suffix='.txt')
        try:
            try:
                os.write(file_descriptor, self.content)
            finally:
                os.close(file_descriptor)

            s3.upload_from_file(s3_path, local_path, self.content_type)
        finally:
            os.remove(local_path)

        self._validate_and_remove_upload(s3_path)
コード例 #4
0
    def test_upload_from_file(self):

        s3.initialize()

        s3_path = 'test-directory/test_002_upload_from_file.txt'

        file_descriptor, local_path = tempfile.mkstemp(suffix='.txt')
        try:
            try:
                os.write(file_descriptor, self.content)
            finally:
                os.close(file_descriptor)

            s3.upload_from_file(
                s3_path,
                local_path,
                self.content_type)
        finally:
            os.remove(local_path)

        self._validate_and_remove_upload( s3_path )
コード例 #5
0
def initialize_infrastructure():
    """  Initialize the AWS infrastructure used by donomo archive.
    """

    s3.initialize()
    sqs.initialize()
コード例 #6
0
def initialize_infrastructure():
    """  Initialize the AWS infrastructure used by donomo archive.
    """

    s3.initialize()
    sqs.initialize()