test(backend): add comprehensive tests for OAuth and agent endpoints

- Added tests for OAuth provider admin and consent endpoints covering edge cases.
- Extended agent-related tests to handle incorrect project associations and lifecycle state transitions.
- Introduced tests for sprint status transitions and validation checks.
- Improved multiline formatting consistency across all test functions.
This commit is contained in:
2026-01-03 01:44:11 +01:00
parent acd18ff694
commit 664415111a
28 changed files with 1530 additions and 216 deletions

View File

@@ -9,7 +9,7 @@ import pytest
import pytest_asyncio
from sqlalchemy.exc import IntegrityError, OperationalError
from app.crud.syndarix.sprint import CRUDSprint, sprint
from app.crud.syndarix.sprint import sprint
from app.models.syndarix import Issue, Project, Sprint
from app.models.syndarix.enums import (
IssueStatus,
@@ -174,7 +174,7 @@ class TestSprintGetByProject:
self, db_session, test_project, test_sprint
):
"""Test getting sprints with status filter."""
sprints, total = await sprint.get_by_project(
sprints, _total = await sprint.get_by_project(
db_session,
project_id=test_project.id,
status=SprintStatus.PLANNED,
@@ -478,7 +478,7 @@ class TestSprintWithIssueCounts:
db_session.add_all([issue1, issue2])
await db_session.commit()
results, total = await sprint.get_sprints_with_issue_counts(
results, _total = await sprint.get_sprints_with_issue_counts(
db_session, project_id=test_project.id
)
assert len(results) == 1