Beispiel #1
0
 def test_grant_invalid_group_xml(self):
     grantee = Element('Grantee', nsmap={'xsi': XMLNS_XSI})
     grantee.set('{%s}type' % XMLNS_XSI, 'Invalid')
     xml = _make_xml(grantee=grantee)
     req = Request.blank('/bucket/object?acl',
                         environ={'REQUEST_METHOD': 'PUT'},
                         headers={
                             'Authorization': 'OSS test:tester:hmac',
                             'Date': self.get_date_header()
                         },
                         body=xml)
     status, headers, body = self.call_oss2swift(req)
     self.assertEqual(self._get_error_code(body), 'MalformedACLError')
Beispiel #2
0
 def test_grant_email_xml(self):
     grantee = Element('Grantee', nsmap={'xsi': XMLNS_XSI})
     grantee.set('{%s}type' % XMLNS_XSI, 'AmazonCustomerByEmail')
     SubElement(grantee, 'EmailAddress').text = '*****@*****.**'
     xml = _make_xml(grantee=grantee)
     req = Request.blank('/bucket/object?acl',
                         environ={'REQUEST_METHOD': 'PUT'},
                         headers={
                             'Authorization': 'OSS test:tester:hmac',
                             'Date': self.get_date_header()
                         },
                         body=xml)
     status, headers, body = self.call_oss2swift(req)
     self.assertEqual(self._get_error_code(body), 'MalformedACLError')