@@ -170,17 +170,17 @@ def test_get_full_texts_pagination(self, mock_execute_sql, api_instance):
170
170
171
171
# Collect all batches from the iterator
172
172
batches = list (api_instance .get_full_texts ("test_folder" ))
173
-
174
- assert len (batches ) == 2 # Should have two batches
175
- assert len (batches [0 ]) == 2 # First batch has 2 records
176
- assert len (batches [1 ]) == 1 # Second batch has 1 record
173
+ records_batches = [ batch [ 0 ] for batch in batches ]
174
+ assert len (records_batches ) == 2 # Should have two batches
175
+ assert len (records_batches [0 ]) == 2 # First batch has 2 records
176
+ assert len (records_batches [1 ]) == 1 # Second batch has 1 record
177
177
178
178
# Verify content of batches
179
- assert batches [0 ] == [
179
+ assert records_batches [0 ] == [
180
180
{"url" : "http://example.com/1" , "full_text" : "Text 1" , "title" : "Title 1" },
181
181
{"url" : "http://example.com/2" , "full_text" : "Text 2" , "title" : "Title 2" },
182
182
]
183
- assert batches [1 ] == [{"url" : "http://example.com/3" , "full_text" : "Text 3" , "title" : "Title 3" }]
183
+ assert records_batches [1 ] == [{"url" : "http://example.com/3" , "full_text" : "Text 3" , "title" : "Title 3" }]
184
184
185
185
def test_get_full_texts_missing_index (self , api_instance ):
186
186
"""
@@ -249,11 +249,12 @@ def test_get_full_texts_batch_size_reduction(self, mock_execute_sql, api_instanc
249
249
]
250
250
251
251
batches = list (api_instance .get_full_texts ("test_folder" , batch_size = 100 , min_batch_size = 1 ))
252
+ records_batches = [batch [0 ] for batch in batches ]
252
253
253
254
# Verify the batches were processed correctly after size reduction
254
255
assert len (batches ) == 1
255
- assert len (batches [0 ]) == 1
256
- assert batches [0 ][0 ]["url" ] == "http://example.com/1"
256
+ assert len (records_batches [0 ]) == 1
257
+ assert records_batches [0 ][0 ]["url" ] == "http://example.com/1"
257
258
258
259
# Verify batch size reduction logic
259
260
assert mock_execute_sql .call_count == 2
0 commit comments