测试里三行超过 120 字的断开写,和周围代码的行宽一致

This commit is contained in:
ThearchyHelios
2026-10-06 17:06:23 +08:00
parent 7f7b690307
commit fbcff1a585
2 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -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"),
# 信息串为空、里面是代码:没有成句的文字;代码注释里的中文句子不算
+4 -3
View File
@@ -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)