mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-25 13:47:27 +00:00
Test to find mismatched MD5
Also clarify the invalid digest test.
This commit is contained in:
parent
a23c81187b
commit
9b17da16cd
1 changed files with 16 additions and 2 deletions
|
@ -176,10 +176,10 @@ def test_object_create_bad_md5_invalid():
|
||||||
|
|
||||||
@attr(resource='object')
|
@attr(resource='object')
|
||||||
@attr(method='put')
|
@attr(method='put')
|
||||||
@attr(operation='create w/incorrect MD5')
|
@attr(operation='create w/invalid MD5')
|
||||||
@attr(assertion='fails 400')
|
@attr(assertion='fails 400')
|
||||||
@nose.with_setup(teardown=_clear_custom_headers)
|
@nose.with_setup(teardown=_clear_custom_headers)
|
||||||
def test_object_create_bad_md5_wrong():
|
def test_object_create_bad_md5_invalid():
|
||||||
key = _setup_bad_object({'Content-MD5':'YWJyYWNhZGFicmE='})
|
key = _setup_bad_object({'Content-MD5':'YWJyYWNhZGFicmE='})
|
||||||
|
|
||||||
e = assert_raises(boto.exception.S3ResponseError, key.set_contents_from_string, 'bar')
|
e = assert_raises(boto.exception.S3ResponseError, key.set_contents_from_string, 'bar')
|
||||||
|
@ -188,6 +188,20 @@ def test_object_create_bad_md5_wrong():
|
||||||
eq(e.error_code, 'InvalidDigest')
|
eq(e.error_code, 'InvalidDigest')
|
||||||
|
|
||||||
|
|
||||||
|
@attr(resource='object')
|
||||||
|
@attr(method='put')
|
||||||
|
@attr(operation='create w/mismatched MD5')
|
||||||
|
@attr(assertion='fails 400')
|
||||||
|
@nose.with_setup(teardown=_clear_custom_headers)
|
||||||
|
def test_object_create_bad_md5_bad():
|
||||||
|
key = _setup_bad_object({'Content-MD5':'rL0Y20zC+Fzt72VPzMSk2A=='})
|
||||||
|
|
||||||
|
e = assert_raises(boto.exception.S3ResponseError, key.set_contents_from_string, 'bar')
|
||||||
|
eq(e.status, 400)
|
||||||
|
eq(e.reason, 'Bad Request')
|
||||||
|
eq(e.error_code, 'BadDigest')
|
||||||
|
|
||||||
|
|
||||||
@attr(resource='object')
|
@attr(resource='object')
|
||||||
@attr(method='put')
|
@attr(method='put')
|
||||||
@attr(operation='create w/empty MD5')
|
@attr(operation='create w/empty MD5')
|
||||||
|
|
Loading…
Reference in a new issue