Verify that ``check_repo_exists`` interprets httpx results correctly.
(status_code: int, *, expected: bool, mocker: MockerFixture)
| 110 | ], |
| 111 | ) |
| 112 | async 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 |
nothing calls this directly
no test coverage detected