fix(gitea): fix 15 failing tests and update documentation
Test Fixes: - Fix mock_config fixture to use 'owner/repo' format (was separate fields) - Update test_client_initialization to match current client API - Add required 'org' argument to get_org_labels, list_repos, aggregate_issues tests - Update error message assertion in test_no_repo_specified_error - Fix test_create_issue to mock is_org_repo and label resolution - Update aggregate_issues tests in test_issues.py with org argument Documentation Updates: - Expand tools table from 8 to 36 tools (organized by category) - Update directory structure to show all 6 tool files - Remove unused GITEA_OWNER from configuration docs - Add automatic repository detection documentation - Add project directory detection strategies - Update test count from 42 to 64 - Create CHANGELOG.md with full version history All 64 tests now pass. No production code changes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -119,22 +119,26 @@ async def test_aggregate_issues_company_mode(issue_tools):
|
||||
'repo2': [{'number': 2}]
|
||||
})
|
||||
|
||||
aggregated = await issue_tools.aggregate_issues()
|
||||
aggregated = await issue_tools.aggregate_issues(org='test_owner')
|
||||
|
||||
assert 'repo1' in aggregated
|
||||
assert 'repo2' in aggregated
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_aggregate_issues_project_mode_error(issue_tools):
|
||||
"""Test that aggregate_issues fails in project mode"""
|
||||
async def test_aggregate_issues_project_mode(issue_tools):
|
||||
"""Test that aggregate_issues works in project mode with org argument"""
|
||||
issue_tools.gitea.mode = 'project'
|
||||
|
||||
with patch.object(issue_tools, '_get_current_branch', return_value='development'):
|
||||
with pytest.raises(ValueError) as exc_info:
|
||||
await issue_tools.aggregate_issues()
|
||||
issue_tools.gitea.aggregate_issues = Mock(return_value={
|
||||
'repo1': [{'number': 1}]
|
||||
})
|
||||
|
||||
assert "only available in company mode" in str(exc_info.value)
|
||||
# aggregate_issues now works in any mode when org is provided
|
||||
aggregated = await issue_tools.aggregate_issues(org='test_owner')
|
||||
|
||||
assert 'repo1' in aggregated
|
||||
|
||||
|
||||
def test_branch_detection():
|
||||
|
||||
Reference in New Issue
Block a user