From 870c19a44b84af847ee3b6b36390ccb4cbad30bb Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Fri, 22 Aug 2014 11:05:09 -0700 Subject: [PATCH] Test delete object on non-existent bucket --- s3tests/functional/test_s3.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index 44db1f1..a28dbb2 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -2152,6 +2152,20 @@ def test_object_raw_get_bucket_gone(): eq(res.reason, 'Not Found') +@attr(resource='object') +@attr(method='delete') +@attr(operation='deleted object and bucket') +@attr(assertion='fails 404') +def test_object_delete_key_bucket_gone(): + (bucket, key) = _setup_request() + key.delete() + bucket.delete() + + e = assert_raises(boto.exception.S3ResponseError, key.delete) + eq(e.status, 404) + eq(e.reason, 'Not Found') + eq(e.error_code, 'NoSuchBucket') + @attr(resource='object') @attr(method='get') @attr(operation='deleted object')