fix: clarify AI generation failure retry states
This commit is contained in:
+34
-1
@@ -1934,6 +1934,39 @@ class GuiTests(TempDirMixin, unittest.TestCase):
|
||||
|
||||
self.assert_removed(temp_dir)
|
||||
|
||||
def test_generate_tab_explains_collect_failed_records_are_not_generatable(self):
|
||||
with self.make_temp_dir() as temp_dir:
|
||||
cfg = self.make_config(temp_dir)
|
||||
accounts.create_account("主店", "alias-a", debug_port=9222, config=cfg)
|
||||
batch_id = db.create_batch(["input.xlsx"], path=cfg["db_path"])
|
||||
db.insert_tasks(
|
||||
batch_id,
|
||||
[
|
||||
{
|
||||
"source_file_abs": os.path.join(temp_dir, "input.xlsx"),
|
||||
"source_sheet": "商品",
|
||||
"source_row": 2,
|
||||
"account_name": "Excel主店",
|
||||
"alias": "alias-a",
|
||||
"item_id": "51100639510",
|
||||
}
|
||||
],
|
||||
path=cfg["db_path"],
|
||||
)
|
||||
task = db.list_tasks(batch_id=batch_id, path=cfg["db_path"])[0]
|
||||
db.mark_failed(task.id, "collect", "采集失败", path=cfg["db_path"])
|
||||
statuses = []
|
||||
tab = GenerateTab(config=cfg, status_callback=statuses.append)
|
||||
self.addCleanup(tab.close)
|
||||
|
||||
self.assertEqual("采集失败", tab.model.index(0, 4).data())
|
||||
tab.start_generate()
|
||||
|
||||
self.assertIsNone(tab.generate_worker)
|
||||
self.assertIn("没有待生成或生成失败可重试任务", statuses[-1])
|
||||
self.assertIn("①导入采集", statuses[-1])
|
||||
|
||||
self.assert_removed(temp_dir)
|
||||
def test_apply_tab_does_not_auto_mix_latest_apply_run_log(self):
|
||||
with self.make_temp_dir() as temp_dir:
|
||||
cfg = self.make_config(temp_dir)
|
||||
@@ -3028,7 +3061,7 @@ class GuiTests(TempDirMixin, unittest.TestCase):
|
||||
tab.status_filter.setCurrentIndex(tab.status_filter.findData("all"))
|
||||
tab.batch_filter.setCurrentIndex(tab.batch_filter.findData(batch_b))
|
||||
self.assertEqual(1, tab.model.rowCount())
|
||||
self.assertEqual("失败", tab.model.index(0, 4).data())
|
||||
self.assertEqual("生成失败", tab.model.index(0, 4).data())
|
||||
self.assert_foreground(tab.model, 0, 4, gui.COLOR_DANGER)
|
||||
self.assertEqual(
|
||||
"生成失败",
|
||||
|
||||
Reference in New Issue
Block a user