Test cloning a repository with a specific subpath. Given a valid repository URL and a specific subpath: When ``clone_repo`` is called, Then the repository should be cloned with sparse checkout enabled and the specified subpath.
(run_command_mock: AsyncMock)
| 265 | |
| 266 | @pytest.mark.asyncio |
| 267 | async def test_clone_with_specific_subpath(run_command_mock: AsyncMock) -> None: |
| 268 | """Test cloning a repository with a specific subpath. |
| 269 | |
| 270 | Given a valid repository URL and a specific subpath: |
| 271 | When ``clone_repo`` is called, |
| 272 | Then the repository should be cloned with sparse checkout enabled and the specified subpath. |
| 273 | """ |
| 274 | # ensure_git_installed + resolve_commit + clone + sparse-checkout + fetch + checkout |
| 275 | subpath = "src/docs" |
| 276 | expected_call_count = GIT_INSTALLED_CALLS + 5 |
| 277 | clone_config = CloneConfig(url=DEMO_URL, local_path=LOCAL_REPO_PATH, subpath=subpath) |
| 278 | |
| 279 | await clone_repo(clone_config) |
| 280 | |
| 281 | # Verify the clone command includes sparse checkout flags |
| 282 | assert_partial_clone_calls(run_command_mock, clone_config, commit=DEMO_COMMIT) |
| 283 | assert run_command_mock.call_count == expected_call_count |
| 284 | |
| 285 | |
| 286 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected