From 8f6c10988260d97656c9672ea9abe2ecf133567f Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 16 Dec 2014 12:56:53 -0800 Subject: [PATCH] test_object_create_bad_authorization_incorrect: fixes The test should expect BadSignature. Also, provide a key that does not already exist on aws. Signed-off-by: Yehuda Sadeh --- s3tests/functional/test_headers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s3tests/functional/test_headers.py b/s3tests/functional/test_headers.py index 7eea631..cedee67 100644 --- a/s3tests/functional/test_headers.py +++ b/s3tests/functional/test_headers.py @@ -503,12 +503,12 @@ def test_object_create_bad_authorization_none(): @attr(assertion='fails 403') @nose.with_setup(teardown=_clear_custom_headers) def test_object_create_bad_authorization_incorrect(): - key = _setup_bad_object({'Authorization': 'AWS AKIAIGR7ZNNBHC5BKSUA:FWeDfwojDSdS2Ztmpfeubhd9isU='}) + key = _setup_bad_object({'Authorization': 'AWS AKIAIGR7ZNNBHC5BKSUB:FWeDfwojDSdS2Ztmpfeubhd9isU='}) e = assert_raises(boto.exception.S3ResponseError, key.set_contents_from_string, 'bar') eq(e.status, 403) eq(e.reason, 'Forbidden') - assert e.error_code in ('AccessDenied', 'SignatureDoesNotMatch') + assert e.error_code in ('AccessDenied', 'SignatureDoesNotMatch', 'InvalidAccessKeyId') @attr(resource='object')