Merge pull request #291 from jbalogh/delimiter

Folder results should include the delimiter.
This commit is contained in:
Steve Pulec 2015-01-29 22:49:09 -05:00
commit 06476ccb3a
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)]