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

        result = SamSwaggerReader._parse_s3_location(location)
        self.assertEquals(result, (self.bucket, self.key, self.version))
Example #2
0
    def test_must_parse_invalid_location(self, location):

        result = SamSwaggerReader._parse_s3_location(location)
        self.assertEquals(result, (None, None, None))
Example #3
0
    def test_must_parse_s3_uri_string_without_version_id(self):
        location = "s3://{}/{}".format(self.bucket, self.key)

        result = SamSwaggerReader._parse_s3_location(location)
        self.assertEquals(result, (self.bucket, self.key, None))
Example #4
0
    def test_must_parse_s3_uri_string(self):
        location = "s3://{}/{}?versionId={}".format(self.bucket, self.key,
                                                    self.version)

        result = SamSwaggerReader._parse_s3_location(location)
        self.assertEquals(result, (self.bucket, self.key, self.version))
Example #5
0
    def test_must_parse_dict_without_version(self):
        location = {"Bucket": self.bucket, "Key": self.key}

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