fix(tests): explanation cap test setup — 한글 chunk 길이 부족 보정

case 3/4 의 setup 이 EXPLANATION_MAX_CHARS (1200) 보다 작은 text 를 만들어
assert 실패. 한글 chunk 반복 횟수 늘려 1200 자 이상 보장.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-05-02 08:35:34 +09:00
parent 6b52d57bac
commit dfc5913c5e
+7 -7
View File
@@ -30,10 +30,10 @@ def test_cap_exactly_at_limit():
def test_cap_long_text_with_paragraph_boundary():
"""1500자 + 마지막 200자 안에 \\n\\n 있으면 거기서 자르기 + …"""
head = "정답 풀이 본문. " * 60 # ~1200자
boundary_pos = 1100
text = head[:boundary_pos] + "\n\n" + "추가 단락 본문." * 50 # 1500자+
"""긴 텍스트 + 마지막 200자 안에 \\n\\n 있으면 거기서 자르기 + …"""
head = "정답 풀이 본문 그리고 추가 설명. " * 100 # 충분히 긴 head
boundary_pos = 1100 # cap (1200) 의 마지막 200 안
text = head[:boundary_pos] + "\n\n" + ("추가 단락 본문이 더 들어갑니다. " * 50)
assert len(text) > EXPLANATION_MAX_CHARS
capped = _cap_explanation_md(text)
assert len(capped) <= EXPLANATION_MAX_CHARS + 1 # + "…"
@@ -41,9 +41,9 @@ def test_cap_long_text_with_paragraph_boundary():
def test_cap_long_text_with_sentence_boundary():
"""\\n\\n 이 없으면 마침표에서 자르기."""
parts = ["문장 한 개가 약간 깁니다. " for _ in range(100)]
text = "".join(parts) # 약 2400자
"""\\n\\n 이 없으면 마침표 / "다." / "요." 에서 자르기."""
parts = ["이 문장은 약간 길게 만든 것입니다. " for _ in range(200)]
text = "".join(parts)
assert len(text) > EXPLANATION_MAX_CHARS
capped = _cap_explanation_md(text)
assert len(capped) <= EXPLANATION_MAX_CHARS + 1