diff --git a/doc/rnc/create_bucket_configuration.rnc b/doc/rnc/create_bucket_configuration.rnc index 53f07d8a..e366d72e 100644 --- a/doc/rnc/create_bucket_configuration.rnc +++ b/doc/rnc/create_bucket_configuration.rnc @@ -1,4 +1,4 @@ start = - element CreateBucketConfiguration { + element * { element LocationConstraint { xsd:string } } diff --git a/swift3/schema/create_bucket_configuration.rng b/swift3/schema/create_bucket_configuration.rng index 0e22a298..882edc46 100644 --- a/swift3/schema/create_bucket_configuration.rng +++ b/swift3/schema/create_bucket_configuration.rng @@ -1,7 +1,8 @@ - + + diff --git a/swift3/test/unit/test_bucket.py b/swift3/test/unit/test_bucket.py index 7b10a644..acd01faa 100644 --- a/swift3/test/unit/test_bucket.py +++ b/swift3/test/unit/test_bucket.py @@ -363,9 +363,8 @@ class TestSwift3Bucket(Swift3TestCase): self.assertEqual(status.split()[0], '200') self.assertEqual(headers['Location'], '/bucket') - @s3acl - def test_bucket_PUT_with_location(self): - elem = Element('CreateBucketConfiguration') + def _test_bucket_PUT_with_location(self, root_element): + elem = Element(root_element) SubElement(elem, 'LocationConstraint').text = 'US' xml = tostring(elem) @@ -377,6 +376,20 @@ class TestSwift3Bucket(Swift3TestCase): status, headers, body = self.call_swift3(req) self.assertEqual(status.split()[0], '200') + @s3acl + def test_bucket_PUT_with_location(self): + self._test_bucket_PUT_with_location('CreateBucketConfiguration') + + @s3acl + def test_bucket_PUT_with_ami_location(self): + # ec2-ami-tools apparently uses CreateBucketConstraint instead? + self._test_bucket_PUT_with_location('CreateBucketConstraint') + + @s3acl + def test_bucket_PUT_with_strange_location(self): + # Even crazier: it doesn't seem to matter + self._test_bucket_PUT_with_location('foo') + def test_bucket_PUT_with_canned_acl(self): req = Request.blank('/bucket', environ={'REQUEST_METHOD': 'PUT'},