feat: improve continuous factory flashing workflow

This commit is contained in:
chenjintao
2026-09-24 13:59:20 +08:00
parent 06b0eaaf70
commit 95d67962b1
7 changed files with 305 additions and 53 deletions
+8
View File
@@ -40,6 +40,12 @@ class FactoryHostTests(unittest.TestCase):
self.assertIn("-a", args)
self.assertNotIn("{port}", args)
def test_auto_flash_binds_each_detected_port(self):
args = factory_host.DEFAULT_CONFIG["flash"]["auto_args"]
self.assertIn("-p", args)
self.assertIn("-a", args)
self.assertIn("{port}", args)
def test_project_root_and_relative_path(self):
self.assertTrue((factory_host.ROOT_DIR / "burn_tool").is_dir())
config = factory_host.load_config(factory_host.CONFIG_PATH)
@@ -53,6 +59,8 @@ class FactoryHostTests(unittest.TestCase):
self.assertTrue(
factory_host.resolve_project_path(config["firmwares"]["official"]).is_file()
)
self.assertIn("burn_tool/firmware/test", config["firmwares"]["production"])
self.assertIn("burn_tool/firmware/official", config["firmwares"]["official"])
def test_ft1_ignores_sdk_log_and_parses_node(self):
self.assertIsNone(parse_ft1_line("DP1312EA is OK!"))