Esempio 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))
Esempio n. 2
0
    def test_must_parse_invalid_location(self, location):

        result = SwaggerReader._parse_s3_location(location)
        self.assertEquals(result, (None, None, None))
Esempio 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))
Esempio 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))
Esempio 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))