Files
Jyotisha/tests/test_report_condition_fallback_2414.py
ClaudeandClaude Opus 5.5 1a2d463e65
Independent Staging Quality Gate / validate-frontend (push) Canceled after 0s
Independent Staging Quality Gate / publish (push) Canceled after 0s
Independent Staging Quality Gate / validate-python (push) Canceled after 3m19s
fix(report): no yoga table or page falls back to 「条件未能逐项列出」; the plain effect stands in, as on the chart page (BUG-2414)
Same rule as BUG-2413: when a rule has no condition sentence, show the
yoga's plain effect, or 「—」. Tables already have an effect column, so a
condition cell that would only repeat it reads 「—」; yoga pages do not
print the effect as a 「组合」.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp3RzgZVEpT1PXxkwHj
2026-11-26 12:47:29 +08:00

21 lines
1.2 KiB
Python

"""BUG-2414: no report table or page prints 「条件未能逐项列出」; the yoga's plain effect stands in (BUG-2413 rule),
and a condition cell that would only repeat the effect column reads 「—」. Synthetic rows only."""
from scripts.report_render.appendix_language import CUSTOM_CONDITION_UNLISTED_ZH, chinese_combination, yoga_cells
from scripts import pl9_interpretation_packs as packs
ROW = {"rule_id": "x_custom", "name": "X Yoga", "name_cn": "某格局", "combination": "自定义条件满足",
"effects": ["学识广博"], "category": "raja", "strength": "中", "planets": ["Jupiter"]}
def test_condition_cell_falls_back_to_the_plain_effect_and_never_the_placeholder():
assert chinese_combination(ROW) == "学识广博"
cells = yoga_cells(ROW, "zh")
assert cells[3] == "—" and cells[4] == "学识广博"
assert CUSTOM_CONDITION_UNLISTED_ZH not in "".join(str(cell) for cell in cells)
def test_yoga_page_does_not_print_the_effect_as_a_combination():
pages = packs.build_yoga_interpretation_pack({"detected_yogas": [ROW]}, {}, set(), language="zh")["pages"]
text = " ".join(str(value) for value in pages[0]["sections"].values())
assert CUSTOM_CONDITION_UNLISTED_ZH not in text and "组合:学识广博" not in text