落地私聊图片询价:识图当口播复用三线文字流程,图上航线三字码保持原样,避免被改写成中文地名。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -106,6 +106,57 @@ class LandCopyTest(unittest.TestCase):
|
||||
def test_no_staff_copy(self):
|
||||
self.assertIn("陆运产品岗", copy.land_group_no_staff())
|
||||
|
||||
def test_ask_land_fields_marks_required_and_lists_optional(self):
|
||||
text = copy.ask_land_fields(
|
||||
facts={
|
||||
"运输类型": "跨境集拼",
|
||||
"线路类别": "东南亚",
|
||||
"运输分类": "急件",
|
||||
"起运港": "广州",
|
||||
"目的港": "河内",
|
||||
"品名": "衣服",
|
||||
"毛重": "50kg",
|
||||
},
|
||||
missing_keys=["体积"],
|
||||
land_subtype="跨境集拼",
|
||||
)
|
||||
self.assertIn("始发站(必填):广州", text)
|
||||
self.assertIn("待补充:", text)
|
||||
self.assertIn("体积(必填)", text)
|
||||
self.assertIn("通关口岸(非必填)", text)
|
||||
self.assertNotIn(copy.LAND_CONFIRM_TAIL, text)
|
||||
|
||||
def test_ask_land_fields_domestic_has_no_customs(self):
|
||||
text = copy.ask_land_fields(
|
||||
facts={
|
||||
"运输类型": "国内运输拼车",
|
||||
"起运港": "广州",
|
||||
"目的港": "深圳",
|
||||
"品名": "衣服",
|
||||
"毛重": "50kg",
|
||||
},
|
||||
missing_keys=["体积"],
|
||||
land_subtype="国内运输拼车",
|
||||
)
|
||||
self.assertIn("体积(必填)", text)
|
||||
self.assertNotIn("通关口岸", text)
|
||||
|
||||
def test_ask_land_fields_filled_customs_not_pending(self):
|
||||
text = copy.ask_land_fields(
|
||||
facts={
|
||||
"运输类型": "中港整车",
|
||||
"起运港": "广州",
|
||||
"目的港": "香港",
|
||||
"品名": "衣服",
|
||||
"通关口岸": "皇岗",
|
||||
},
|
||||
missing_keys=["起运港"],
|
||||
land_subtype="中港整车",
|
||||
)
|
||||
self.assertIn("通关口岸(非必填):皇岗", text)
|
||||
pending = text.split("待补充:", 1)[1]
|
||||
self.assertNotIn("通关口岸", pending)
|
||||
|
||||
def test_inquiry_card_lists_land_fields_and_wo(self):
|
||||
text = copy.inquiry_card(
|
||||
work_order_no="WO202609170006",
|
||||
@@ -261,6 +312,14 @@ class LandCopyTest(unittest.TestCase):
|
||||
self.assertIn("客户名称", text)
|
||||
self.assertNotIn("货好时间", text)
|
||||
|
||||
def test_image_copy(self):
|
||||
self.assertEqual(copy.IMAGE_RECOGNIZING, "正在识别图片")
|
||||
self.assertIn("没看清", copy.IMAGE_UNREADABLE)
|
||||
self.assertIn("暂时没认出来", copy.IMAGE_TECH_FAIL)
|
||||
merged = copy.image_fail_then_clarify(copy.IMAGE_UNREADABLE, copy.ASK_TRANSPORT)
|
||||
self.assertTrue(merged.startswith(copy.IMAGE_UNREADABLE))
|
||||
self.assertIn(copy.ASK_TRANSPORT, merged)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user