diff --git a/logistics_chat/knowledge.py b/logistics_chat/knowledge.py index a3066c4..ec1cfea 100644 --- a/logistics_chat/knowledge.py +++ b/logistics_chat/knowledge.py @@ -212,7 +212,7 @@ knowledge_list = [ "text":"英国专线(DPD)双清价格:英国海运21KG+ 12.8元/kg、101KG+/301KG+ 10.9元/kg,时效约40天提取;英国铁路21KG+ 18.0元/kg、101KG+ 16.2元/kg,发车后25-30天提取;中英卡航21KG+ 21.4元/kg、101KG+ 19.4元/kg,发车后20-22天提取。VAT自税/递延价更低(海运10.0/8.1、铁路15/13.2、卡航18.4/16.4)。北极航线英国海运25-28天,价格单询。卡航单件不超30kg、尺寸≤98×68×59cm。" }, { - "keys":["英国空运","英国","UK","伦敦"], + "keys":["英国空运","英国空运价格","英国空运多久","英国空运多少钱","英国","UK","伦敦"], "text":"英国空运专线(双清)单价:22KG+ 48元/kg,51KG+ 44元/kg,101KG+ 42元/kg,时效8-10个自然日提取。VAT自税/递延为44/40/38元/kg,带电货47.5/42.5/41.5元/kg。拒收北爱尔兰、苏格兰高地等偏远地址。" }, { diff --git a/tests/test_rules.py b/tests/test_rules.py index a1bd46a..21c6aa3 100644 --- a/tests/test_rules.py +++ b/tests/test_rules.py @@ -13,7 +13,9 @@ from logistics_chat import knowledge, pricing, tracking class RuleTests(unittest.TestCase): def test_specific_knowledge_wins_and_unknown_questions_have_no_match(self): - self.assertIn('22KG+', knowledge.search_knowledge('英国空运价格')) + for question in ('英国空运价格','英国空运多久','英国空运多少钱'): + self.assertIn('22KG+', knowledge.search_knowledge(question)) + self.assertIn('21KG+', knowledge.search_knowledge('欧洲空运价格')) self.assertIsNone(knowledge.search_knowledge('没有相关关键词的测试')) def test_sea_tier_boundary_and_minimum(self):