MCPcopy
hub / github.com/coderamp-labs/gitingest / test_clone_with_timeout

Function test_clone_with_timeout

tests/test_clone.py:212–224  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

210
211@pytest.mark.asyncio
212async 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

Callers

nothing calls this directly

Calls 2

CloneConfigClass · 0.90
clone_repoFunction · 0.90

Tested by

no test coverage detected