@@ -96,7 +96,8 @@ def _purge_temp_docs(self, cb_env, test_ids):
9696 except DocumentNotFoundException :
9797 pass
9898
99- def _validate_result (self , result , expected_count = 0 , ids_only = False , return_rows = False , from_sample = False ):
99+ def _validate_result (self , result , expected_count = 0 , ids_only = False , return_rows = False , from_sample = False ,
100+ skip_content_validation = False ):
100101 assert isinstance (result , ScanResultIterable )
101102 rows = []
102103 for r in result :
@@ -113,7 +114,8 @@ def _validate_result(self, result, expected_count=0, ids_only=False, return_rows
113114 assert r .id is not None
114115 content = r .content_as [dict ]
115116 assert content is not None
116- assert content == {'id' : r .id }
117+ if not skip_content_validation :
118+ assert content == {'id' : r .id }
117119 rows .append (r )
118120
119121 if from_sample is True :
@@ -179,7 +181,8 @@ def test_sampling_scan(self, cb_env, test_mutation_state):
179181 res = cb_env .collection .scan (scan_type , ScanOptions (timeout = timedelta (seconds = 10 ),
180182 ids_only = False ,
181183 consistent_with = test_mutation_state ))
182- self ._validate_result (res , limit , ids_only = False , return_rows = False , from_sample = True )
184+ self ._validate_result (res , limit , ids_only = False , return_rows = False , from_sample = True ,
185+ skip_content_validation = (not cb_env .use_named_collections ))
183186
184187 @pytest .mark .usefixtures ('check_range_scan_supported' )
185188 def test_sampling_scan_with_seed (self , cb_env , test_ids , test_mutation_state ):
@@ -188,7 +191,8 @@ def test_sampling_scan_with_seed(self, cb_env, test_ids, test_mutation_state):
188191 res = cb_env .collection .scan (scan_type , ScanOptions (timeout = timedelta (seconds = 10 ),
189192 ids_only = True ,
190193 consistent_with = test_mutation_state ))
191- rows = self ._validate_result (res , limit , ids_only = True , return_rows = True , from_sample = True )
194+ rows = self ._validate_result (res , limit , ids_only = True , return_rows = True , from_sample = True ,
195+ skip_content_validation = (not cb_env .use_named_collections ))
192196 result_ids = []
193197 for r in rows :
194198 result_ids .append (r .id )
@@ -197,7 +201,8 @@ def test_sampling_scan_with_seed(self, cb_env, test_ids, test_mutation_state):
197201 res = cb_env .collection .scan (scan_type , ScanOptions (timeout = timedelta (seconds = 10 ),
198202 ids_only = True ,
199203 consistent_with = test_mutation_state ))
200- rows = self ._validate_result (res , limit , ids_only = True , return_rows = True , from_sample = True )
204+ rows = self ._validate_result (res , limit , ids_only = True , return_rows = True , from_sample = True ,
205+ skip_content_validation = (not cb_env .use_named_collections ))
201206 compare_ids = list (map (lambda r : r .id , rows ))
202207 assert result_ids == compare_ids
203208
@@ -279,7 +284,7 @@ def test_sampling_scan_with_batch_byte_limit(self, cb_env, test_id, test_mutatio
279284 ScanOptions (timeout = timedelta (seconds = 10 ),
280285 batch_byte_limit = batch_byte_limit ,
281286 consistent_with = test_mutation_state ))
282- self ._validate_result (res , 100 , from_sample = True )
287+ self ._validate_result (res , 100 , from_sample = True , skip_content_validation = ( not cb_env . use_named_collections ) )
283288
284289 @pytest .mark .usefixtures ('check_range_scan_supported' )
285290 @pytest .mark .parametrize ('batch_item_limit' , [0 , 1 , 25 , 100 ])
@@ -289,7 +294,7 @@ def test_sampling_scan_with_batch_item_limit(self, cb_env, test_id, test_mutatio
289294 ScanOptions (timeout = timedelta (seconds = 10 ),
290295 batch_item_limit = batch_item_limit ,
291296 consistent_with = test_mutation_state ))
292- self ._validate_result (res , 100 , from_sample = True )
297+ self ._validate_result (res , 100 , from_sample = True , skip_content_validation = ( not cb_env . use_named_collections ) )
293298
294299 @pytest .mark .usefixtures ('check_range_scan_supported' )
295300 @pytest .mark .parametrize ('concurrency' , [1 , 2 , 4 , 16 , 64 , 128 ])
@@ -299,7 +304,7 @@ def test_sampling_scan_with_concurrency(self, cb_env, test_id, test_mutation_sta
299304 ScanOptions (timeout = timedelta (seconds = 10 ),
300305 concurrency = concurrency ,
301306 consistent_with = test_mutation_state ))
302- self ._validate_result (res , 100 , from_sample = True )
307+ self ._validate_result (res , 100 , from_sample = True , skip_content_validation = ( not cb_env . use_named_collections ) )
303308
304309 @pytest .mark .usefixtures ('check_range_scan_supported' )
305310 def test_range_scan_with_zero_concurrency (self , cb_env , test_id , test_mutation_state ):
0 commit comments