meraproject/services/user-reader/tests/test_project_status.py
keboss-m 5c21d25d45 Initial commit: Merakomis portal, Docker stack and user-reader API.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:04:05 +03:00

25 lines
670 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from app.project_status import (
PROJECT_STATUS_NAMES,
enrich_project_status_fields,
project_status_name,
)
def test_project_status_name():
assert project_status_name(1) == "В работе"
assert project_status_name(2) == "Завершён"
assert project_status_name(99) == ""
assert project_status_name(None) == ""
def test_enrich_project_status_fields():
row = enrich_project_status_fields(
{"status": 3, "archive_date": "2024-01-09"}
)
assert row["status_name"] == "Пауза"
assert row["archive_date"] == "2024-01-09"
def test_status_map_complete():
assert set(PROJECT_STATUS_NAMES) == {0, 1, 2, 3}