]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
add test for no bucket list delimiter
authorStephon Striplin <stephon.striplin@dreamhost.com>
Tue, 9 Aug 2011 22:02:54 +0000 (15:02 -0700)
committerStephon Striplin <stephon.striplin@dreamhost.com>
Tue, 9 Aug 2011 22:02:54 +0000 (15:02 -0700)
s3tests/functional/test_s3.py

index b414d6ad450ccd21fa47e6515e7c146bc5639732..955320bfb401bae8d978e3225a361ff216aca4a7 100644 (file)
@@ -158,6 +158,22 @@ def test_bucket_list_prefix_none():
     bucket = _create_keys(keys=key_names)
 
     li = bucket.list()
+    eq(li.prefix, '')
+
+    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_list_prefix_none_is_delimiter():
+    key_names = ['b/a/c', 'b/a/g', 'b/a/r', 'g']
+    bucket = _create_keys(keys=key_names)
+
+    li = bucket.list(delimiter='/')
     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)]