Exemplo n.º 1
0
    def test_must_parse_valid_dict(self):
        location = {
            "Bucket": self.bucket,
            "Key": self.key,
            "Version": self.version
        }

        result = SwaggerReader._parse_s3_location(location)
        self.assertEquals(result, (self.bucket, self.key, self.version))
Exemplo n.º 2
0
    def test_must_parse_invalid_location(self, location):

        result = SwaggerReader._parse_s3_location(location)
        self.assertEquals(result, (None, None, None))
Exemplo n.º 3
0
    def test_must_parse_s3_uri_string_without_version_id(self):
        location = "s3://{}/{}".format(self.bucket, self.key)

        result = SwaggerReader._parse_s3_location(location)
        self.assertEquals(result, (self.bucket, self.key, None))
Exemplo n.º 4
0
    def test_must_parse_s3_uri_string(self):
        location = "s3://{}/{}?versionId={}".format(self.bucket, self.key,
                                                    self.version)

        result = SwaggerReader._parse_s3_location(location)
        self.assertEquals(result, (self.bucket, self.key, self.version))
Exemplo n.º 5
0
    def test_must_parse_dict_without_version(self):
        location = {"Bucket": self.bucket, "Key": self.key}

        result = SwaggerReader._parse_s3_location(location)
        self.assertEquals(result, (self.bucket, self.key, None))