mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
add test for checking bucket list with no prefix
This commit is contained in:
parent
0e698734b6
commit
881c09f626
1 changed files with 14 additions and 0 deletions
|
@ -153,6 +153,20 @@ def test_bucket_list_prefix_not_exist():
|
|||
eq(names, [])
|
||||
|
||||
|
||||
def test_bucket_list_prefix_none():
|
||||
key_names = ['b/a/c', 'b/a/g', 'b/a/r', 'g']
|
||||
bucket = _create_keys(keys=key_names)
|
||||
|
||||
li = bucket.list()
|
||||
keys = [x for x in li if isinstance(x, boto.s3.key.Key)]
|
||||
prefixes = [x for x in li if not isinstance(x, boto.s3.key.Key)]
|
||||
|
||||
eq(prefixes, [])
|
||||
|
||||
names = [e.name for e in keys]
|
||||
eq(names, key_names)
|
||||
|
||||
|
||||
def test_bucket_notexist():
|
||||
name = '{prefix}foo'.format(prefix=get_prefix())
|
||||
print 'Trying bucket {name!r}'.format(name=name)
|
||||
|
|
Loading…
Reference in a new issue