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

Function test_check_repo_exists

tests/test_clone.py:112–121  ·  view source on GitHub ↗

Verify that ``check_repo_exists`` interprets httpx results correctly.

(status_code: int, *, expected: bool, mocker: MockerFixture)

Source from the content-addressed store, hash-verified

110 ],
111)
112async def test_check_repo_exists(status_code: int, *, expected: bool, mocker: MockerFixture) -> None:
113 """Verify that ``check_repo_exists`` interprets httpx results correctly."""
114 mock_client = AsyncMock()
115 mock_client.__aenter__.return_value = mock_client # context-manager protocol
116 mock_client.head.return_value = httpx.Response(status_code=status_code)
117 mocker.patch("httpx.AsyncClient", return_value=mock_client)
118
119 result = await check_repo_exists(DEMO_URL)
120
121 assert result is expected
122
123
124@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 1

check_repo_existsFunction · 0.90

Tested by

no test coverage detected