diff --git a/test_s3.py b/test_s3.py index 7545f6b..bed1c8c 100644 --- a/test_s3.py +++ b/test_s3.py @@ -806,16 +806,14 @@ def test_object_giveaway(): obj = _setup_access(bucket_acl='public-read', object_acl='public-read-write') CORRECT_ACL = '' + config.main.user_id + '' + config.main.user_id + 'FULL_CONTROL' WRONG_ACL = '' + config.alt.user_id + '' + config.alt.user_id + 'FULL_CONTROL' - #try: bucket = get_new_bucket() key = bucket.new_key('foo') key.set_contents_from_string('bar') key.set_xml_acl(CORRECT_ACL) - try: - key.set_xml_acl(WRONG_ACL) - raise RuntimeError("S3 implementation allowed us to give away an object!") - except boto.exception.S3ResponseError, e: - pass + e = assert_raises(boto.exception.S3ResponseError, key.set_xml_acl, WRONG_ACL) + eq(e.status, 403) + eq(e.reason, 'Forbidden') + eq(e.error_code, 'AccessDenied') def test_buckets_create_then_list(): create_buckets = [get_new_bucket() for i in xrange(5)]