mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-22 09:29:43 +00:00
add User-Agent header tests
This commit is contained in:
parent
82ac4f0138
commit
405f33e10c
1 changed files with 24 additions and 0 deletions
|
@ -225,3 +225,27 @@ def test_object_create_bad_contenttype_unreadable():
|
|||
eq(e.status, 403)
|
||||
eq(e.reason, 'Forbidden')
|
||||
assert e.error_code in ('AccessDenied', 'SignatureDoesNotMatch')
|
||||
|
||||
|
||||
@nose.with_setup(teardown=_clear_custom_headers)
|
||||
def test_object_create_bad_ua_invalid():
|
||||
key = _setup_bad_object({'User-Agent': ''})
|
||||
key.set_contents_from_string('bar')
|
||||
|
||||
|
||||
@nose.with_setup(teardown=_clear_custom_headers)
|
||||
def test_object_create_bad_ua_empty():
|
||||
key = _setup_bad_object({'User-Agent': ''})
|
||||
key.set_contents_from_string('bar')
|
||||
|
||||
|
||||
@nose.with_setup(teardown=_clear_custom_headers)
|
||||
def test_object_create_bad_ua_unreadable():
|
||||
key = _setup_bad_object({'User-Agent': '\x07'})
|
||||
key.set_contents_from_string('bar')
|
||||
|
||||
|
||||
@nose.with_setup(teardown=_clear_custom_headers)
|
||||
def test_object_create_bad_ua_none():
|
||||
key = _setup_bad_object(remove=('User-Agent',))
|
||||
key.set_contents_from_string('bar')
|
||||
|
|
Loading…
Reference in a new issue