Folder results should include the delimiter.

This commit is contained in:
Jeff Balogh 2015-01-29 09:20:40 -08:00
parent d8d55dc7fa
commit c7bf6ffc91
3 changed files with 3 additions and 3 deletions

View File

@ -333,7 +333,7 @@ class S3Backend(BaseBackend):
for key_name, key in bucket.keys.items():
if delimiter and delimiter in key_name:
# If delimiter, we need to split out folder_results
folder_results.add(key_name.split(delimiter)[0])
folder_results.add(key_name.split(delimiter)[0] + delimiter)
else:
key_results.add(key)

View File

@ -496,7 +496,7 @@ def test_bucket_key_listing_order():
# Test delimiter with no prefix
delimiter = '/'
keys = [x.name for x in bucket.list(prefix=None, delimiter=delimiter)]
keys.should.equal(['toplevel'])
keys.should.equal(['toplevel/'])
delimiter = None
keys = [x.name for x in bucket.list(prefix + 'x', delimiter)]

View File

@ -272,7 +272,7 @@ def test_bucket_key_listing_order():
# Test delimiter with no prefix
delimiter = '/'
keys = [x.name for x in bucket.list(prefix=None, delimiter=delimiter)]
keys.should.equal(['toplevel'])
keys.should.equal(['toplevel/'])
delimiter = None
keys = [x.name for x in bucket.list(prefix + 'x', delimiter)]