调价后的新价格写入报价单;多段段前的货物带到各段,协同群不再把体积里的星号吃掉。海运字段齐了先核对再查价。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -133,6 +133,29 @@ class SplitTests(unittest.TestCase):
|
||||
self.assertTrue(outcome.ok)
|
||||
self.assertEqual([seg.mode for seg in outcome.segments], ["LAND", "SEA"])
|
||||
|
||||
def test_cargo_before_ordinal_segments_fills_both(self) -> None:
|
||||
"""段前写一次的品名、尺寸、重量、件数,陆运和空运都要带上。"""
|
||||
oral = (
|
||||
"茶叶,1.1*2.1*2.2,11kg,21件\n"
|
||||
"第一段陆运,北京到上海\n"
|
||||
"第二段空运,上海到北宁"
|
||||
)
|
||||
outcome = split_segments(oral)
|
||||
self.assertTrue(outcome.ok)
|
||||
self.assertEqual([seg.index for seg in outcome.segments], [1, 2])
|
||||
self.assertEqual([seg.mode for seg in outcome.segments], ["LAND", "AIR"])
|
||||
land, air = outcome.segments
|
||||
self.assertEqual(land.facts.get("品名"), "茶叶")
|
||||
self.assertEqual(air.facts.get("品名"), "茶叶")
|
||||
self.assertEqual(air.facts.get("件数"), "21件")
|
||||
self.assertEqual(air.facts.get("毛重"), "11kg")
|
||||
self.assertEqual(air.facts.get("体积"), "1.1*2.1*2.2")
|
||||
_, _, gaps = refresh_segments(outcome.segments)
|
||||
self.assertNotIn("品名(必填):\n(如:茶叶)", gaps)
|
||||
self.assertNotIn("重量(KG)(必填):\n(如:", gaps)
|
||||
self.assertNotIn("体积(CBM)(必填):\n(如:", gaps)
|
||||
self.assertNotIn("件数(必填):\n(如:", gaps)
|
||||
|
||||
def test_group_brief_has_no_blank_under_mentions(self) -> None:
|
||||
"""拉群摘要 @人后直接接段1,中间不要空行。"""
|
||||
segs = split_segments(SEA_AIR).segments
|
||||
|
||||
Reference in New Issue
Block a user