b1eafa4e0b
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
import pytest
|
|
from app.services.export import _protocol_to_markdown, _format_section_value
|
|
|
|
|
|
def test_format_section_value_string():
|
|
assert _format_section_value("Hello world") == "Hello world"
|
|
|
|
|
|
def test_format_section_value_list():
|
|
result = _format_section_value(["item1", "item2"])
|
|
assert "- item1" in result
|
|
assert "- item2" in result
|
|
|
|
|
|
def test_format_section_value_list_of_dicts():
|
|
tasks = [{"task": "Do X", "responsible": "Alice", "deadline": "2026-04-10"}]
|
|
result = _format_section_value(tasks)
|
|
assert "task: Do X" in result
|
|
assert "responsible: Alice" in result
|
|
|
|
|
|
def test_protocol_to_markdown():
|
|
content = {
|
|
"date_participants_topic": "01.04.2026, Иванов, Петров",
|
|
"problems": ["Проблема 1", "Проблема 2"],
|
|
"next_steps": "Назначить следующую встречу",
|
|
}
|
|
md = _protocol_to_markdown(content)
|
|
assert "# Протокол встречи" in md
|
|
assert "## Дата, участники, тема встречи" in md
|
|
assert "## Выявленные проблемы" in md
|
|
assert "- Проблема 1" in md
|
|
assert "## Следующие шаги" in md
|