From fbcff1a58527caacfa7372828714b7ca13d626dc Mon Sep 17 00:00:00 2001 From: ThearchyHelios Date: Tue, 6 Oct 2026 17:06:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=87=8C=E4=B8=89=E8=A1=8C?= =?UTF-8?q?=E8=B6=85=E8=BF=87=20120=20=E5=AD=97=E7=9A=84=E6=96=AD=E5=BC=80?= =?UTF-8?q?=E5=86=99=EF=BC=8C=E5=92=8C=E5=91=A8=E5=9B=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E8=A1=8C=E5=AE=BD=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/tests/test_contract_fenced_body.py | 3 ++- backend/tests/test_dual_check_facts.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/tests/test_contract_fenced_body.py b/backend/tests/test_contract_fenced_body.py index d6c30c61..be6006b5 100644 --- a/backend/tests/test_contract_fenced_body.py +++ b/backend/tests/test_contract_fenced_body.py @@ -73,7 +73,8 @@ def test_a_report_body_in_a_prose_code_block_is_recognised(raw): @pytest.mark.parametrize("raw", [ # 代码:信息串写明了语言 - pytest.param("```sql\nSELECT region, SUM(amount) AS gmv FROM orders WHERE amount > 100 GROUP BY region\n```", id="sql"), + pytest.param("```sql\nSELECT region, SUM(amount) AS gmv FROM orders WHERE amount > 100 GROUP BY region\n```", + id="sql"), pytest.param("```python\nprint('华东销售额最高,华南次之。')\n```", id="python"), pytest.param('```json\n{"区域": "华东,华南"}\n```', id="json"), # 信息串为空、里面是代码:没有成句的文字;代码注释里的中文句子不算 diff --git a/backend/tests/test_dual_check_facts.py b/backend/tests/test_dual_check_facts.py index b13851fa..0e27e978 100644 --- a/backend/tests/test_dual_check_facts.py +++ b/backend/tests/test_dual_check_facts.py @@ -386,7 +386,8 @@ def test_an_uploaded_column_the_import_took_as_a_date_is_a_date(): for choice, column in (("a", "order_date"), ("b", "paid_date")): fact, why = derive(uploaded(BY_ORDER_DATE, RIGHT, choice, both), texts) assert why is None, why - assert (fact.table, fact.item, fact.value, fact.choice) == ("orders", "business_date", {"column": column}, choice) + assert (fact.table, fact.item, fact.value, fact.choice) == \ + ("orders", "business_date", {"column": column}, choice) said = preview(uploaded(BY_ORDER_DATE, RIGHT, choice, both), texts, {}) assert said[choice] == {"write": True, "source": "shop", "table": "orders", "item": "business_date", "value": {"column": column}} @@ -434,8 +435,8 @@ def test_the_import_dates_follow_the_names_in_the_table_structure(): """差异说明里的名字是规范化过的(不加引号的一律小写),配方里、表结构里的写法可能带大写:按表结构认出的那一列去对 upload_dates,大小写不同照样对得上。""" upper = {"tables": {"Orders": {"name": "Orders", "columns": [ - {"name": "Status", "type": "TEXT"}, {"name": "Order_Date", "type": "TEXT"}, {"name": "Paid_Date", "type": "TEXT"}, - {"name": "Amount", "type": "REAL"}]}}} + {"name": "Status", "type": "TEXT"}, {"name": "Order_Date", "type": "TEXT"}, + {"name": "Paid_Date", "type": "TEXT"}, {"name": "Amount", "type": "REAL"}]}}} fact, why = derive(uploaded(BY_ORDER_DATE, RIGHT, "b", {"Orders": ["Order_Date", "Paid_Date"]}), upper) assert why is None and (fact.table, fact.value) == ("Orders", {"column": "paid_date"}) fact, why = derive(uploaded(BY_ORDER_DATE, RIGHT, "b", {"orders": ["order_date", "paid_date"]}), upper)