Test cloning a repository when no commit hash is provided. Given a valid URL and no commit hash: When ``clone_repo`` is called, Then only the clone_repo operation should be performed (no checkout).
(repo_exists_true: AsyncMock, run_command_mock: AsyncMock)
| 60 | |
| 61 | @pytest.mark.asyncio |
| 62 | async def test_clone_without_commit(repo_exists_true: AsyncMock, run_command_mock: AsyncMock) -> None: |
| 63 | """Test cloning a repository when no commit hash is provided. |
| 64 | |
| 65 | Given a valid URL and no commit hash: |
| 66 | When ``clone_repo`` is called, |
| 67 | Then only the clone_repo operation should be performed (no checkout). |
| 68 | """ |
| 69 | expected_call_count = GIT_INSTALLED_CALLS + 4 # ensure_git_installed + resolve_commit + clone + fetch + checkout |
| 70 | clone_config = CloneConfig(url=DEMO_URL, local_path=LOCAL_REPO_PATH, commit=None, branch="main") |
| 71 | |
| 72 | await clone_repo(clone_config) |
| 73 | |
| 74 | repo_exists_true.assert_any_call(clone_config.url, token=None) |
| 75 | assert_standard_calls(run_command_mock, clone_config, commit=DEMO_COMMIT) |
| 76 | assert run_command_mock.call_count == expected_call_count |
| 77 | |
| 78 | |
| 79 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected