refactor: update module docstrings for clarity and consistency

This commit is contained in:
Abhimanyu Saharan
2026-02-09 15:49:50 +05:30
parent 78bb08d4a3
commit 7ca1899d9f
99 changed files with 2345 additions and 855 deletions

View File

@@ -1,3 +1,6 @@
# ruff: noqa: INP001
"""Schema validation tests for board and onboarding goal requirements."""
from uuid import uuid4
import pytest
@@ -6,8 +9,12 @@ from app.schemas.board_onboarding import BoardOnboardingConfirm
from app.schemas.boards import BoardCreate
def test_goal_board_requires_objective_and_metrics_when_confirmed():
with pytest.raises(ValueError):
def test_goal_board_requires_objective_and_metrics_when_confirmed() -> None:
"""Confirmed goal boards should require objective and success metrics."""
with pytest.raises(
ValueError,
match="Confirmed goal boards require objective and success_metrics",
):
BoardCreate(
name="Goal Board",
slug="goal",
@@ -27,22 +34,39 @@ def test_goal_board_requires_objective_and_metrics_when_confirmed():
)
def test_goal_board_allows_missing_objective_before_confirmation():
def test_goal_board_allows_missing_objective_before_confirmation() -> None:
"""Draft goal boards may omit objective/success_metrics before confirmation."""
BoardCreate(name="Draft", slug="draft", gateway_id=uuid4(), board_type="goal")
def test_general_board_allows_missing_objective():
BoardCreate(name="General", slug="general", gateway_id=uuid4(), board_type="general")
def test_general_board_allows_missing_objective() -> None:
"""General boards should allow missing goal-specific fields."""
BoardCreate(
name="General",
slug="general",
gateway_id=uuid4(),
board_type="general",
)
def test_onboarding_confirm_requires_goal_fields():
with pytest.raises(ValueError):
def test_onboarding_confirm_requires_goal_fields() -> None:
"""Onboarding confirm should enforce goal fields for goal board types."""
with pytest.raises(
ValueError,
match="Confirmed goal boards require objective and success_metrics",
):
BoardOnboardingConfirm(board_type="goal")
with pytest.raises(ValueError):
with pytest.raises(
ValueError,
match="Confirmed goal boards require objective and success_metrics",
):
BoardOnboardingConfirm(board_type="goal", objective="Ship onboarding")
with pytest.raises(ValueError):
with pytest.raises(
ValueError,
match="Confirmed goal boards require objective and success_metrics",
):
BoardOnboardingConfirm(board_type="goal", success_metrics={"emails": 3})
BoardOnboardingConfirm(