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

@@ -108,7 +108,9 @@ class TestCreateIssue:
assert "urgent" in data["labels"]
assert "frontend" in data["labels"]
async def test_create_issue_with_story_points(self, client, user_token, test_project):
async def test_create_issue_with_story_points(
self, client, user_token, test_project
):
"""Test creating issue with story points."""
project_id = test_project["id"]
@@ -237,7 +239,9 @@ class TestListIssues:
assert len(data["data"]) == 1
assert data["data"][0]["status"] == "open"
async def test_list_issues_filter_by_priority(self, client, user_token, test_project):
async def test_list_issues_filter_by_priority(
self, client, user_token, test_project
):
"""Test filtering issues by priority."""
project_id = test_project["id"]
@@ -703,7 +707,9 @@ class TestIssueAssignment:
assert response.status_code == status.HTTP_404_NOT_FOUND
async def test_assign_issue_clears_assignment(self, client, user_token, test_project):
async def test_assign_issue_clears_assignment(
self, client, user_token, test_project
):
"""Test that assigning to null clears both assignments."""
project_id = test_project["id"]
@@ -890,7 +896,9 @@ class TestIssueCrossProjectValidation:
class TestIssueValidation:
"""Tests for issue validation during create/update."""
async def test_create_issue_invalid_priority(self, client, user_token, test_project):
async def test_create_issue_invalid_priority(
self, client, user_token, test_project
):
"""Test creating issue with invalid priority."""
project_id = test_project["id"]
@@ -922,7 +930,9 @@ class TestIssueValidation:
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
async def test_update_issue_invalid_priority(self, client, user_token, test_project):
async def test_update_issue_invalid_priority(
self, client, user_token, test_project
):
"""Test updating issue with invalid priority."""
project_id = test_project["id"]