]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Add a test case for list objects v2 with both continuation token and start after...
authorzhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Tue, 16 Jul 2019 11:03:25 +0000 (19:03 +0800)
committerzhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Tue, 16 Jul 2019 11:03:25 +0000 (19:03 +0800)
Signed-off-by: zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
s3tests_boto3/functional/test_s3.py

index 16a1a32ea4edbfee6aee9e78587abc9cca0443dc..827409f73aa215de211efc6d7426aa563960a694 100644 (file)
@@ -1409,6 +1409,24 @@ def test_bucket_listv2_continuationtoken():
     keys = _get_keys(response)
     eq(keys, key_names2)
 
+@attr(resource='bucket')
+@attr(method='get')
+@attr(operation='list keys with list-objects-v2')
+@attr(assertion='no pagination, non-empty continuationtoken and startafter')
+@attr('list-objects-v2')
+def test_bucket_listv2_both_continuationtoken_startafter():
+    key_names = ['bar', 'baz', 'foo', 'quxx']
+    bucket_name = _create_objects(keys=key_names)
+    client = get_client()
+
+    response = client.list_objects_v2(Bucket=bucket_name, StartAfter='bar', ContinuationToken='baz')
+    eq(response['ContinuationToken'], 'baz')
+    eq(response['StartAfter'], 'bar')
+    eq(response['IsTruncated'], False)
+    key_names2 = ['foo', 'quxx']
+    keys = _get_keys(response)
+    eq(keys, key_names2)
+
 @attr(resource='bucket')
 @attr(method='get')
 @attr(operation='list all keys')