Compare commits
3 commits
1bbc472086
...
22779291c6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22779291c6 | ||
|
|
295cc426b1 | ||
|
|
85a95b28b9 |
2 changed files with 56 additions and 12 deletions
|
|
@ -60,18 +60,6 @@ class TestNoLegacyOutputFormatSection:
|
|||
f"Файлы с устаревшей секцией '## Output format': {files_with_old_header}"
|
||||
)
|
||||
|
||||
def test_grep_output_format_is_empty(self):
|
||||
"""Эквивалент: grep -rl '## Output format' agents/prompts/ — пустой вывод."""
|
||||
matches = [
|
||||
str(f)
|
||||
for f in _prompt_files()
|
||||
if "## Output format" in f.read_text(encoding="utf-8")
|
||||
]
|
||||
assert matches == [], (
|
||||
"grep -rl '## Output format' agents/prompts/ должен давать пустой вывод, "
|
||||
f"но нашёл: {matches}"
|
||||
)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# AC-3: Every prompt contains '## Return Format'
|
||||
|
|
|
|||
56
tests/test_kin_docs_009_regression.py
Normal file
56
tests/test_kin_docs_009_regression.py
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
"""Regression tests for KIN-DOCS-009 — Удалить дублирующий тест-метод в TestNoLegacyOutputFormatSection.
|
||||
|
||||
Acceptance criteria:
|
||||
1. TestNoLegacyOutputFormatSection содержит ровно один метод проверки отсутствия '## Output format'
|
||||
2. Единственный метод называется test_no_prompt_contains_old_output_format_header
|
||||
3. Удалённый дубль test_grep_output_format_is_empty отсутствует в классе
|
||||
"""
|
||||
|
||||
import inspect
|
||||
|
||||
import pytest
|
||||
|
||||
import tests.test_kin_docs_002_regression as target_module
|
||||
from tests.test_kin_docs_002_regression import TestNoLegacyOutputFormatSection
|
||||
|
||||
|
||||
def _get_test_methods(cls):
|
||||
"""Возвращает список имён методов, начинающихся с 'test_'."""
|
||||
return [
|
||||
name
|
||||
for name, _ in inspect.getmembers(cls, predicate=inspect.isfunction)
|
||||
if name.startswith("test_")
|
||||
]
|
||||
|
||||
|
||||
class TestKinDocs009Regression:
|
||||
"""Верифицирует удаление дублирующего метода из TestNoLegacyOutputFormatSection."""
|
||||
|
||||
def test_class_has_exactly_one_test_method(self):
|
||||
"""TestNoLegacyOutputFormatSection содержит ровно один test_-метод."""
|
||||
methods = _get_test_methods(TestNoLegacyOutputFormatSection)
|
||||
assert len(methods) == 1, (
|
||||
f"Ожидался 1 метод, найдено {len(methods)}: {methods}"
|
||||
)
|
||||
|
||||
def test_canonical_method_exists(self):
|
||||
"""Метод test_no_prompt_contains_old_output_format_header существует в классе."""
|
||||
assert hasattr(TestNoLegacyOutputFormatSection, "test_no_prompt_contains_old_output_format_header"), (
|
||||
"Канонический метод test_no_prompt_contains_old_output_format_header отсутствует в классе"
|
||||
)
|
||||
|
||||
def test_duplicate_method_is_removed(self):
|
||||
"""Удалённый дубль test_grep_output_format_is_empty отсутствует в классе."""
|
||||
assert not hasattr(TestNoLegacyOutputFormatSection, "test_grep_output_format_is_empty"), (
|
||||
"Дублирующий метод test_grep_output_format_is_empty всё ещё присутствует в классе"
|
||||
)
|
||||
|
||||
def test_no_other_output_format_checking_methods(self):
|
||||
"""В классе нет скрытых методов, проверяющих '## Output format' по иному имени."""
|
||||
methods = _get_test_methods(TestNoLegacyOutputFormatSection)
|
||||
# Единственный разрешённый метод
|
||||
allowed = {"test_no_prompt_contains_old_output_format_header"}
|
||||
unexpected = set(methods) - allowed
|
||||
assert not unexpected, (
|
||||
f"Найдены неожиданные методы в TestNoLegacyOutputFormatSection: {unexpected}"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue