Merge pull request #295 from tianshan/test_pr_29215

add test case for list with delimiter not skip special keys

Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
This commit is contained in:
J. Eric Ivancich 2019-08-13 17:09:52 -04:00 committed by GitHub
commit e9ac946d0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -715,6 +715,26 @@ def test_bucket_listv2_delimiter_not_exist():
eq(keys, key_names) eq(keys, key_names)
eq(prefixes, []) eq(prefixes, [])
@attr(resource='bucket')
@attr(method='get')
@attr(operation='list')
@attr(assertion='list with delimiter not skip special keys')
def test_bucket_list_delimiter_not_skip_special():
key_names = ['0/'] + ['0/%s' % i for i in range(1000, 1999)]
key_names2 = ['1999', '1999#', '1999+', '2000']
key_names += key_names2
bucket_name = _create_objects(keys=key_names)
client = get_client()
response = client.list_objects(Bucket=bucket_name, Delimiter='/')
eq(response['Delimiter'], '/')
keys = _get_keys(response)
prefixes = _get_prefixes(response)
eq(keys, key_names2)
eq(prefixes, ['0/'])
@attr(resource='bucket') @attr(resource='bucket')
@attr(method='get') @attr(method='get')
@attr(operation='list under prefix') @attr(operation='list under prefix')