Test cloning when a commit hash is provided. Given a valid URL and a commit hash: When ``clone_repo`` is called, Then the repository should be cloned and checked out at that commit.
(run_command_mock: AsyncMock)
| 173 | |
| 174 | @pytest.mark.asyncio |
| 175 | async def test_clone_commit(run_command_mock: AsyncMock) -> None: |
| 176 | """Test cloning when a commit hash is provided. |
| 177 | |
| 178 | Given a valid URL and a commit hash: |
| 179 | When ``clone_repo`` is called, |
| 180 | Then the repository should be cloned and checked out at that commit. |
| 181 | """ |
| 182 | expected_call_count = GIT_INSTALLED_CALLS + 3 # ensure_git_installed + clone + fetch + checkout |
| 183 | commit_hash = "a" * 40 # Simulating a valid commit hash |
| 184 | clone_config = CloneConfig(url=DEMO_URL, local_path=LOCAL_REPO_PATH, commit=commit_hash) |
| 185 | |
| 186 | await clone_repo(clone_config) |
| 187 | |
| 188 | assert_standard_calls(run_command_mock, clone_config, commit=commit_hash) |
| 189 | assert run_command_mock.call_count == expected_call_count |
| 190 | |
| 191 | |
| 192 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected