空运锁舱按报价来源出站,航线回 2 视为不用 TMS。补陆运常用线路超时,海运举例行不再当成已选分类。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-24 18:28:13 +08:00
co-authored by Cursor
parent 37278aa0db
commit 5402f94d30
21 changed files with 624 additions and 94 deletions
+11
View File
@@ -26,6 +26,9 @@ class SeaOptionsTest(unittest.TestCase):
self.assertEqual(canonicalize_sea_class("port to port"), "Port to Port")
self.assertEqual(canonicalize_sea_class("P2P"), "Port to Port")
self.assertEqual(canonicalize_sea_class("港到港"), "Port to Port")
glued = "15件,Port\u00a0to\u00a0Port\n贸易条款:DOOR-DOOR"
self.assertEqual(canonicalize_sea_class(glued), "Port to Port")
self.assertEqual(harvest_sea_class(glued, {}).get("运输分类"), "Port to Port")
def test_other_alias(self):
self.assertEqual(canonicalize_sea_class("其他"), "其他")
@@ -42,6 +45,14 @@ class SeaOptionsTest(unittest.TestCase):
got = harvest_sea_class("运输分类:其他", {"运输分类": "Port to Port"})
self.assertEqual(got["运输分类"], "其他")
def test_clarify_example_does_not_override_filled_other(self):
"""举例行里的 Port to Port 不能盖掉冒号后的其它/其他。"""
pasted = "1.运输分类(必填):其它\n(如:Port to Port、其他)"
got = harvest_sea_class(pasted, {"运输分类": "Port to Port"})
self.assertEqual(got["运输分类"], "其他")
other = harvest_sea_class("运输分类(必填):其他\n(如:Port to Port、其他)", {})
self.assertEqual(other["运输分类"], "其他")
def test_door_to_door_not_kept_as_trade_terms(self):
text = "海运、纽约港到巴生西港,机器设备,40HQ*1,整柜,1.5KG,15CBM,15件"
got = drop_invented_door_trade_terms(text, {"贸易条款": "门到门", "品名": "机器设备"})