@@ -170,17 +170,16 @@ 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
- 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
173
+ assert len (batches ) == 2 # Should have two batches
174
+ assert len (batches [0 ]) == 2 # First batch has 2 records
175
+ assert len (batches [1 ]) == 1 # Second batch has 1 record
177
176
178
177
# Verify content of batches
179
- assert records_batches [0 ] == [
178
+ assert batches [0 ] == [
180
179
{"url" : "http://example.com/1" , "full_text" : "Text 1" , "title" : "Title 1" },
181
180
{"url" : "http://example.com/2" , "full_text" : "Text 2" , "title" : "Title 2" },
182
181
]
183
- assert records_batches [1 ] == [{"url" : "http://example.com/3" , "full_text" : "Text 3" , "title" : "Title 3" }]
182
+ assert batches [1 ] == [{"url" : "http://example.com/3" , "full_text" : "Text 3" , "title" : "Title 3" }]
184
183
185
184
def test_get_full_texts_missing_index (self , api_instance ):
186
185
"""
@@ -249,12 +248,11 @@ def test_get_full_texts_batch_size_reduction(self, mock_execute_sql, api_instanc
249
248
]
250
249
251
250
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 ]
253
251
254
252
# Verify the batches were processed correctly after size reduction
255
253
assert len (batches ) == 1
256
- assert len (records_batches [0 ]) == 1
257
- assert records_batches [0 ][0 ]["url" ] == "http://example.com/1"
254
+ assert len (batches [0 ]) == 1
255
+ assert batches [0 ][0 ]["url" ] == "http://example.com/1"
258
256
259
257
# Verify batch size reduction logic
260
258
assert mock_execute_sql .call_count == 2
0 commit comments