feat: refine settings sections

This commit is contained in:
chengma
2026-07-02 10:59:21 +08:00
parent 820612c3ab
commit 86b931b26d
5 changed files with 65 additions and 30 deletions
+13 -6
View File
@@ -291,14 +291,21 @@ class GuiTests(TempDirMixin, unittest.TestCase):
self.assertEqual(QLineEdit.Password, tab.api_key_edit.echoMode())
self.assertEqual(11, tab.connect_timeout_spin.value())
self.assertFalse(tab.delete_model_button.isEnabled())
self.assertEqual("51100639510", tab.test_item_id_edit.text())
self.assertTrue(tab.test_item_id_edit.isHidden())
self.assertFalse(hasattr(tab, "test_item_id_edit"))
self.assertFalse(hasattr(tab, "dry_run_checkbox"))
self.assertEqual(
"Shopee 更新安全 / 执行模式",
tab.shopee_update_section_title.text(),
)
self.assertEqual("基础设施(路径与端口)", tab.infrastructure_section_title.text())
self.assertLess(
tab.settings_panel_layout.indexOf(tab.shopee_update_section_title),
tab.settings_panel_layout.indexOf(tab.infrastructure_section_title),
)
self.assertFalse(tab.allow_real_submit_checkbox.isChecked())
self.assertFalse(tab.allow_cover_update_checkbox.isChecked())
self.assertEqual(1, tab.max_items_per_run_spin.value())
self.assertFalse(tab.close_success_tab_checkbox.isChecked())
self.assertFalse(tab.dry_run_checkbox.isChecked())
self.assertTrue(tab.dry_run_checkbox.isHidden())
self.assertFalse(tab.parallel_accounts_checkbox.isChecked())
self.assertEqual(2, tab.max_parallel_accounts_spin.value())
@@ -527,7 +534,6 @@ class GuiTests(TempDirMixin, unittest.TestCase):
tab.debug_port_start_spin.setValue(9300)
tab.debug_port_end_spin.setValue(9350)
tab.cdp_ready_timeout_spin.setValue(45)
tab.test_item_id_edit.setText("51100639510")
tab.allow_real_submit_checkbox.setChecked(True)
tab.allow_cover_update_checkbox.setChecked(True)
tab.max_items_per_run_spin.setValue(2)
@@ -576,6 +582,8 @@ class GuiTests(TempDirMixin, unittest.TestCase):
def test_settings_save_updates_apply_tab_shared_safety_config(self):
with self.make_temp_dir() as temp_dir:
cfg = self.make_config(temp_dir)
cfg["shopee_update"] = dict(appconfig.default_config()["shopee_update"])
cfg["shopee_update"]["test_item_id"] = "123456789"
window = MainWindow(
config=cfg,
config_path=cfg["config_path"],
@@ -585,7 +593,6 @@ class GuiTests(TempDirMixin, unittest.TestCase):
settings_tab = window.tabs.widget(TAB_TITLES.index("⑤ 设置"))
apply_tab = window.tabs.widget(TAB_TITLES.index("③ 更新shopee"))
settings_tab.test_item_id_edit.setText("123456789")
settings_tab.allow_real_submit_checkbox.setChecked(True)
settings_tab.allow_cover_update_checkbox.setChecked(True)
settings_tab.max_items_per_run_spin.setValue(3)