Skip to content

Commit 1804266

Browse files
author
Your Name
committed
Updated the associated TCs
1 parent 9fb6ad5 commit 1804266

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

sde_collections/tests/test_sinequa_api.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,17 @@ def test_get_full_texts_pagination(self, mock_execute_sql, api_instance):
170170

171171
# Collect all batches from the iterator
172172
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
177177

178178
# Verify content of batches
179-
assert batches[0] == [
179+
assert records_batches[0] == [
180180
{"url": "http://example.com/1", "full_text": "Text 1", "title": "Title 1"},
181181
{"url": "http://example.com/2", "full_text": "Text 2", "title": "Title 2"},
182182
]
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"}]
184184

185185
def test_get_full_texts_missing_index(self, api_instance):
186186
"""
@@ -249,11 +249,12 @@ def test_get_full_texts_batch_size_reduction(self, mock_execute_sql, api_instanc
249249
]
250250

251251
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]
252253

253254
# Verify the batches were processed correctly after size reduction
254255
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"
257258

258259
# Verify batch size reduction logic
259260
assert mock_execute_sql.call_count == 2

0 commit comments

Comments
 (0)