test: final 6 agents — 172+ translate tests, llm_analysis 89%, git_plugin 100%, migration/deps/routes polished. 85-94% files pushed to 95%+. Bulk: backup/debug/maintenance plugins

This commit is contained in:
2026-06-15 22:04:40 +03:00
parent 010edfcfdc
commit fd27569488
35 changed files with 7811 additions and 49 deletions

View File

@@ -29,8 +29,6 @@ class TestResolveBasePathCoverage:
config.payload = {"settings": {"storage": {"root_path": "data", "repo_path": "repositories"}}}
mock_db.query.return_value.filter.return_value.first.return_value = config
svc = GitServiceBase(base_path="git_repos")
# Verify the _resolve_base_path already ran in __init__
# We can test this by checking that base_path has been resolved
assert svc.base_path is not None
def test_db_config_with_repo_path(self):
@@ -44,7 +42,6 @@ class TestResolveBasePathCoverage:
mock_db.query.return_value.filter.return_value.first.return_value = config
svc = GitServiceBase(base_path="git_repos")
assert svc.base_path is not None
# When root_path is absolute and repo_path relative → root / repo_path
assert "/data/my-repos" in svc.base_path
def test_db_config_absolute_repo_path(self):
@@ -59,6 +56,34 @@ class TestResolveBasePathCoverage:
svc = GitServiceBase(base_path="git_repos")
assert "/custom/path" in svc.base_path
def test_relative_root_relative_repo_combined(self):
"""Root path is relative, repo_path is relative → combined after resolving root."""
with patch.object(GitServiceBase, '_ensure_base_path_exists'), \
patch("src.services.git._base.SessionLocal") as mock_sl:
mock_db = MagicMock()
mock_sl.return_value = mock_db
config = MagicMock()
config.payload = {"settings": {"storage": {"root_path": "relative/data", "repo_path": "custom-repos"}}}
mock_db.query.return_value.filter.return_value.first.return_value = config
svc = GitServiceBase(base_path="git_repos")
# root is relative → resolved against project_root (line 155)
# repo_path is relative → combined with resolved root (line 159)
assert "custom-repos" in svc.base_path
def test_relative_root_absolute_repo(self):
"""Root path is relative, repo_path is absolute → absolute repo_path returned."""
with patch.object(GitServiceBase, '_ensure_base_path_exists'), \
patch("src.services.git._base.SessionLocal") as mock_sl:
mock_db = MagicMock()
mock_sl.return_value = mock_db
config = MagicMock()
config.payload = {"settings": {"storage": {"root_path": "relative/data", "repo_path": "/absolute/repo/path"}}}
mock_db.query.return_value.filter.return_value.first.return_value = config
svc = GitServiceBase(base_path="git_repos")
# root is relative → resolved (line 155)
# repo_path is absolute → returned directly (line 158)
assert "/absolute/repo/path" in svc.base_path
class TestUpdateRepoLocalPathCoverage:
"""Cover exception handler in _update_repo_local_path."""