Exemplo n.º 1
0
 def test_repr(self):
     local_client = local.LocalSyncClient('/home/bobs/burgers')
     s3_client = s3.S3SyncClient(None, 'burgerbucket', 'foozie')
     worker = sync.SyncWorker(local_client, s3_client)
     assert repr(
         worker
     ) == 'SyncWorker</home/bobs/burgers/, s3://burgerbucket/foozie/>'
Exemplo n.º 2
0
    def test_index_path(self):
        s3_client = boto3.client("s3",
                                 aws_access_key_id="",
                                 aws_secret_access_key="",
                                 aws_session_token="")

        client = s3.S3SyncClient(s3_client, "testbucket", "foo/bar")
        assert client.index_path() == "foo/bar/.index"
Exemplo n.º 3
0
    def test_repr(self):
        boto_client = boto3.client("s3",
                                   aws_access_key_id="",
                                   aws_secret_access_key="",
                                   aws_session_token="")

        client = s3.S3SyncClient(boto_client, "testbucket", "foo/bar")
        assert repr(client) == "S3SyncClient<testbucket, foo/bar>"
Exemplo n.º 4
0
 def test_repr(self):
     s3_client = s3.S3SyncClient(None, 'mortybucket', 'dimensional/portals')
     local_client = local.LocalSyncClient('/home/picklerick')
     resolution = Resolution(Resolution.CREATE, s3_client, local_client,
                             'foo', 20023)
     expected_repr = ("Resolution<action=CREATE, "
                      "to=s3://mortybucket/dimensional/portals/, "
                      "from=/home/picklerick/, "
                      "key=foo, timestamp=20023>")
     assert repr(resolution) == expected_repr
Exemplo n.º 5
0
def get_s3_client(target, aws_access_key_id, aws_secret_access_key,
                  region_name):
    s3_uri = s3.parse_s3_uri(target)
    s3_client = boto3.client(
        's3',
        aws_access_key_id=aws_access_key_id,
        aws_secret_access_key=aws_secret_access_key,
        region_name=region_name,
    )
    return s3.S3SyncClient(s3_client, s3_uri.bucket, s3_uri.key)
Exemplo n.º 6
0
    def test_get_uri(self):
        s3_client = boto3.client("s3",
                                 aws_access_key_id="",
                                 aws_secret_access_key="",
                                 aws_session_token="")

        client = s3.S3SyncClient(s3_client, "testbucket", "foo/bar")
        assert client.get_uri() == "s3://testbucket/foo/bar/"
        assert client.get_uri(
            "apples.txt") == "s3://testbucket/foo/bar/apples.txt"
Exemplo n.º 7
0
Arquivo: test_s3.py Projeto: epayet/S4
    def test_index_path(self):
        s3_client = boto3.client(
            's3',
            aws_access_key_id='',
            aws_secret_access_key='',
            aws_session_token='',
        )

        client = s3.S3SyncClient(s3_client, 'testbucket', 'foo/bar')
        assert client.index_path() == 'foo/bar/.index'
Exemplo n.º 8
0
Arquivo: test_s3.py Projeto: epayet/S4
    def test_repr(self):
        boto_client = boto3.client(
            's3',
            aws_access_key_id='',
            aws_secret_access_key='',
            aws_session_token='',
        )

        client = s3.S3SyncClient(boto_client, 'testbucket', 'foo/bar')
        assert repr(client) == 'S3SyncClient<testbucket, foo/bar>'
Exemplo n.º 9
0
Arquivo: test_s3.py Projeto: epayet/S4
    def test_get_uri(self):
        s3_client = boto3.client(
            's3',
            aws_access_key_id='',
            aws_secret_access_key='',
            aws_session_token='',
        )

        client = s3.S3SyncClient(s3_client, 'testbucket', 'foo/bar')
        assert client.get_uri() == 's3://testbucket/foo/bar/'
        assert client.get_uri('apples.txt') == 's3://testbucket/foo/bar/apples.txt'
Exemplo n.º 10
0
 def test_repr(self):
     local_client = local.LocalSyncClient("/home/bobs/burgers")
     s3_client = s3.S3SyncClient(None, "burgerbucket", "foozie")
     worker = sync.SyncWorker(local_client, s3_client)
     assert (repr(worker) ==
             "SyncWorker</home/bobs/burgers/, s3://burgerbucket/foozie/>")