Test cloning a repository when a timeout occurs. Given a valid URL, but ``run_command`` times out: When ``clone_repo`` is called, Then an ``AsyncTimeoutError`` should be raised to indicate the operation exceeded time limits.
(run_command_mock: AsyncMock)
| 210 | |
| 211 | @pytest.mark.asyncio |
| 212 | async def test_clone_with_timeout(run_command_mock: AsyncMock) -> None: |
| 213 | """Test cloning a repository when a timeout occurs. |
| 214 | |
| 215 | Given a valid URL, but ``run_command`` times out: |
| 216 | When ``clone_repo`` is called, |
| 217 | Then an ``AsyncTimeoutError`` should be raised to indicate the operation exceeded time limits. |
| 218 | """ |
| 219 | clone_config = CloneConfig(url=DEMO_URL, local_path=LOCAL_REPO_PATH) |
| 220 | |
| 221 | run_command_mock.side_effect = asyncio.TimeoutError |
| 222 | |
| 223 | with pytest.raises(AsyncTimeoutError, match="Operation timed out after"): |
| 224 | await clone_repo(clone_config) |
| 225 | |
| 226 | |
| 227 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected