fix(ai-outfit): preview sample rows ignore Excel status (§19.9)
Add excel_service.read_all_rows (every valid data row, status-independent) and use it in _reload_sample_rows for the preview dropdown, so previewing still works after the whole sheet is 完成. Generation still uses load_outfit_tasks. +1 excel test (read_all_rows includes 完成/失败, skips incomplete); offscreen all-完成 sheet now yields sample rows; full suite (12) green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -96,6 +96,18 @@ class TestOutfitExcelService(unittest.TestCase):
|
||||
|
||||
self.assertEqual(self._read_row(2), (None, "失败", "衣服图打不开"))
|
||||
|
||||
def test_read_all_rows_includes_done_failed_skips_incomplete(self):
|
||||
from services.excel_service import read_all_rows
|
||||
|
||||
rows = read_all_rows(self.excel_path)
|
||||
|
||||
# rows 2(待处理) 3(完成) 4(失败) 6(待处理) — row 5 (空衣服图) skipped
|
||||
self.assertEqual([r.row_index for r in rows], [2, 3, 4, 6])
|
||||
by_idx = {r.row_index: r for r in rows}
|
||||
self.assertEqual(by_idx[3].status, "完成")
|
||||
self.assertEqual(by_idx[4].status, "失败")
|
||||
self.assertEqual(by_idx[6].title, " 保留空格 ") # raw text preserved
|
||||
|
||||
def test_check_excel_writable_true_for_existing_workbook(self):
|
||||
from services.excel_service import check_excel_writable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user