The existing test_object_create_bad_md5_invalid is not valid
base64, and hence triggers a different code path. This time,
submit valid base64, but have the result not match the expected
md5sum.
eq(e.error_code, 'InvalidDigest')
+@nose.with_setup(teardown=_clear_custom_headers)
+@attr('fails_on_dho')
+def test_object_create_bad_md5_wrong():
+ key = _setup_bad_object({'Content-MD5':'YWJyYWNhZGFicmE='})
+
+ 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, 'InvalidDigest')
+
+
@nose.with_setup(teardown=_clear_custom_headers)
@attr('fails_on_dho')
def test_object_create_bad_md5_empty():