Test cloning when the Git command fails during execution. Given a valid URL, but ``run_command`` raises a RuntimeError: When ``clone_repo`` is called, Then a RuntimeError should be raised with the correct message.
(run_command_mock: AsyncMock)
| 140 | |
| 141 | @pytest.mark.asyncio |
| 142 | async def test_git_command_failure(run_command_mock: AsyncMock) -> None: |
| 143 | """Test cloning when the Git command fails during execution. |
| 144 | |
| 145 | Given a valid URL, but ``run_command`` raises a RuntimeError: |
| 146 | When ``clone_repo`` is called, |
| 147 | Then a RuntimeError should be raised with the correct message. |
| 148 | """ |
| 149 | clone_config = CloneConfig(url=DEMO_URL, local_path=LOCAL_REPO_PATH) |
| 150 | |
| 151 | run_command_mock.side_effect = RuntimeError("Git is not installed or not accessible. Please install Git first.") |
| 152 | |
| 153 | with pytest.raises(RuntimeError, match="Git is not installed or not accessible"): |
| 154 | await clone_repo(clone_config) |
| 155 | |
| 156 | |
| 157 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected