样本接收 UC… 此前无内置匹配规则导致工单空任务;新增 5 步原代培养模版与回补脚本,且不影响 BC 六步模版。 Co-authored-by: Cursor <cursoragent@cursor.com>
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
import os
|
|
import unittest
|
|
|
|
# 避免导入 app.models 时 Settings 因缺 SECRET_KEY 失败
|
|
os.environ.setdefault(
|
|
"SECRET_KEY", "test-secret-key-for-uc-msc-unit-tests-32c"
|
|
)
|
|
|
|
|
|
class TestUcMscBuiltinTemplate(unittest.TestCase):
|
|
def test_step_order_matches_business_five_nodes(self):
|
|
from app.services.uc_msc_builtin_template import UC_MSC_STEP_ORDER
|
|
|
|
self.assertEqual(
|
|
UC_MSC_STEP_ORDER,
|
|
[
|
|
"SOP-SC-003-E01-01",
|
|
"SOP-SC-004-E01-01",
|
|
"SOP-SC-006-E01-01",
|
|
"SOP-SC-005-E01-01",
|
|
"SOP-SC-008-E01-01",
|
|
],
|
|
)
|
|
self.assertNotIn("SOP-SC-007-E01-01", UC_MSC_STEP_ORDER)
|
|
|
|
def test_uc_prefix_maps_to_uc_set_name(self):
|
|
from app.services.uc_msc_builtin_template import UC_MSC_ROUTE_CODE
|
|
from app.utils.lab_storage_code_task_set import (
|
|
UC_MSC_BUILTIN_SET_NAME,
|
|
match_builtin_task_set_name_by_lab_storage_code,
|
|
)
|
|
|
|
self.assertEqual(UC_MSC_ROUTE_CODE, "MSC原代-UC-BUILTIN")
|
|
self.assertEqual(
|
|
match_builtin_task_set_name_by_lab_storage_code("UC2026010"),
|
|
UC_MSC_BUILTIN_SET_NAME,
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|