调价后的新价格写入报价单;多段段前的货物带到各段,协同群不再把体积里的星号吃掉。海运字段齐了先核对再查价。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -71,6 +71,32 @@ class SeaOptionsTest(unittest.TestCase):
|
||||
example = apply_spoken_sea_trade_reply("(如:门到门、港到港)", {})
|
||||
self.assertNotIn("贸易条款", example)
|
||||
|
||||
def test_door_inside_long_sentence_is_trade_term(self):
|
||||
"""先报货再选海运:长句里的门到门是贸易条款,港到港仍是运输分类。"""
|
||||
from agent.schema.sea_options import apply_spoken_sea_trade_reply
|
||||
|
||||
text = "广州港到巴生港,机器设备,40HQ*1,整柜,1.5KG,15CBM,15件,Port to Port,门到门"
|
||||
got = apply_spoken_sea_trade_reply(text, {"运输分类": "Port to Port"})
|
||||
self.assertEqual(got.get("贸易条款"), "门到门")
|
||||
self.assertEqual(got.get("运输分类"), "Port to Port")
|
||||
absent = apply_spoken_sea_trade_reply(
|
||||
"广州港到巴生港,机器设备,40HQ*1,整柜,Port to Port",
|
||||
{"贸易条款": "门到门", "运输分类": "Port to Port"},
|
||||
)
|
||||
self.assertNotIn("贸易条款", absent)
|
||||
self.assertEqual(absent.get("运输分类"), "Port to Port")
|
||||
port_term = apply_spoken_sea_trade_reply(
|
||||
"广州港到巴生港,机器设备,40HQ*1,整柜,1.5KG,15CBM,15件,Port to Port,港到港",
|
||||
{"运输分类": "Port to Port"},
|
||||
)
|
||||
self.assertEqual(port_term.get("贸易条款"), "港到港")
|
||||
self.assertEqual(port_term.get("运输分类"), "Port to Port")
|
||||
invented = apply_spoken_sea_trade_reply(
|
||||
"广州港到巴生港,机器设备,40HQ*1,整柜,Port to Port",
|
||||
{"贸易条款": "港到港"},
|
||||
)
|
||||
self.assertNotIn("贸易条款", invented)
|
||||
|
||||
def test_wo012_trade_port_class_other(self):
|
||||
"""条款写 Port to Port、分类写其它:二者各归各栏,禁止互盖。"""
|
||||
text = (
|
||||
|
||||
Reference in New Issue
Block a user