]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Update the continuation token test case so that it won't fail on aws 291/head
authorzhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Thu, 18 Jul 2019 07:06:06 +0000 (15:06 +0800)
committerzhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Thu, 18 Jul 2019 07:06:06 +0000 (15:06 +0800)
Signed-off-by: zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
s3tests_boto3/functional/test_s3.py

index 827409f73aa215de211efc6d7426aa563960a694..3f7090d800513fdf7fee23929ff24b3bb3049293 100644 (file)
@@ -1402,11 +1402,14 @@ def test_bucket_listv2_continuationtoken():
     bucket_name = _create_objects(keys=key_names)
     client = get_client()
 
-    response = client.list_objects_v2(Bucket=bucket_name, ContinuationToken='baz')
-    eq(response['ContinuationToken'], 'baz')
-    eq(response['IsTruncated'], False)
-    key_names2 = ['foo', 'quxx']
-    keys = _get_keys(response)
+    response1 = client.list_objects_v2(Bucket=bucket_name, MaxKeys=1)
+    next_continuation_token = response1['NextContinuationToken']
+
+    response2 = client.list_objects_v2(Bucket=bucket_name, ContinuationToken=next_continuation_token)
+    eq(response2['ContinuationToken'], next_continuation_token)
+    eq(response2['IsTruncated'], False)
+    key_names2 = ['baz', 'foo', 'quxx']
+    keys = _get_keys(response2)
     eq(keys, key_names2)
 
 @attr(resource='bucket')
@@ -1419,12 +1422,15 @@ def test_bucket_listv2_both_continuationtoken_startafter():
     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)
+    response1 = client.list_objects_v2(Bucket=bucket_name, StartAfter='bar', MaxKeys=1)
+    next_continuation_token = response1['NextContinuationToken']
+
+    response2 = client.list_objects_v2(Bucket=bucket_name, StartAfter='bar', ContinuationToken=next_continuation_token)
+    eq(response2['ContinuationToken'], next_continuation_token)
+    eq(response2['StartAfter'], 'bar')
+    eq(response2['IsTruncated'], False)
     key_names2 = ['foo', 'quxx']
-    keys = _get_keys(response)
+    keys = _get_keys(response2)
     eq(keys, key_names2)
 
 @attr(resource='bucket')