空运成交后可在本群继续锁舱;调价同步舱位费用桶;出单按空运段骨架落费并保留陆运车型尺寸;导出文件名乱码修复。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -65,6 +65,32 @@ class AirRouteOptionsTests(unittest.TestCase):
|
||||
self.assertTrue(needs_route_pick(quote))
|
||||
self.assertEqual(len(parse_air_options(quote)), 2)
|
||||
|
||||
def test_route_codes_tolerates_string_selected_option(self) -> None:
|
||||
"""主账若把 selected_air_option 存成 JSON 串或编号串,不能再 dict(字符串) 炸掉成交卡。"""
|
||||
quote_json = {
|
||||
"selected_air_option": (
|
||||
'{"originAirportCode":"NKG","destinationAirportCode":"KUL"}'
|
||||
),
|
||||
}
|
||||
self.assertEqual(
|
||||
route_codes(None, {"起运港": "南京", "目的港": "吉隆坡"}, quote_json),
|
||||
"NKG-KUL",
|
||||
)
|
||||
quote_code = {
|
||||
"selected_air_option": "AIR-OPT01",
|
||||
"airOptions": [
|
||||
{
|
||||
"optionNo": "AIR-OPT01",
|
||||
"originAirportCode": "SZX",
|
||||
"destinationAirportCode": "CGK",
|
||||
}
|
||||
],
|
||||
}
|
||||
self.assertEqual(
|
||||
route_codes(None, {"起运港": "深圳", "目的港": "雅加达"}, quote_code),
|
||||
"SZX-CGK",
|
||||
)
|
||||
|
||||
def test_select_writes_origin(self) -> None:
|
||||
option = {"originAirportCode": "SZX", "destinationAirportCode": "KUL"}
|
||||
facts = apply_selected_option({"目的港": "吉隆坡"}, option)
|
||||
|
||||
Reference in New Issue
Block a user