]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Merge pull request #77 from andrewgaul/special-key-names
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 18 Dec 2015 17:52:58 +0000 (09:52 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 18 Dec 2015 17:52:58 +0000 (09:52 -0800)
Consolidate test_object_create_special_characters

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
1  2 
s3tests/functional/test_s3.py

index 7f1e22e7a7714fb814fa7690e70bd370d18f8a7c,d90cd745d2eaa6f02156a44e56b7c3ce5819e559..4563eb88e7e98444bc85fe36c350d4e1c08e6c0b
@@@ -904,42 -832,7 +904,28 @@@ def test_object_read_notexist()
      eq(e.reason, 'Not Found')
      eq(e.error_code, 'NoSuchKey')
  
 +@attr(resource='object')
 +@attr(method='get')
 +@attr(operation='read contents that were never written to raise one error response')
 +@attr(assertion='RequestId appears in the error response')
 +def test_object_requestid_on_error():
 +    bucket = get_new_bucket()
 +    key = bucket.new_key('foobar')
 +    e = assert_raises(boto.exception.S3ResponseError, key.get_contents_as_string)
 +    request_id = re.search(r'<RequestId>.*</RequestId>', e.body.encode('utf-8')).group(0)
 +    assert request_id is not None
 +
 +@attr(resource='object')
 +@attr(method='get')
 +@attr(operation='read contents that were never written to raise one error response')
 +@attr(assertion='RequestId in the error response matchs the x-amz-request-id in the headers')
 +def test_object_requestid_matchs_header_on_error():
 +    bucket = get_new_bucket()
 +    key = bucket.new_key('foobar')
 +    e = assert_raises(boto.exception.S3ResponseError, key.get_contents_as_string)
 +    request_id = re.search(r'<RequestId>(.*)</RequestId>', e.body.encode('utf-8')).group(1)
 +    eq(key.resp.getheader('x-amz-request-id'), request_id)
  
- @attr(resource='object')
- @attr(method='put')
- @attr(operation='write to special characters key')
- @attr(assertion='fails 404')
- def test_object_create_special_characters():
-     bucket = get_new_bucket()
-     # sourced from: http://xml.silmaril.ie/specials.html
-     key = bucket.new_key('<&>"\'')
-     key.set_contents_from_string('bar')
-     got = key.get_contents_as_string()
-     eq(got, 'bar')
-     bucket.get_all_keys()
  # While the test itself passes, there's a SAX parser error during teardown. It
  # seems to be a boto bug.  It happens with both amazon and dho.
  # http://code.google.com/p/boto/issues/detail?id=501