25 lines
670 B
Python
25 lines
670 B
Python
|
|
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}
|