Refactor: Replace httpx with curl-cffi for HTTP requests and update dependencies

This commit is contained in:
bohd4nx
2026-07-05 16:13:16 +03:00
parent d78be012a3
commit fd31342d03
5 changed files with 22 additions and 33 deletions
+3 -3
View File
@@ -2,8 +2,8 @@
from unittest.mock import AsyncMock, MagicMock, patch
import httpx
import pytest
from curl_cffi.requests import AsyncSession, Response
from pyfragment import FragmentClient, FragmentPageError
from pyfragment.core.transport import fragment_request
@@ -67,10 +67,10 @@ async def test_call_merges_extra_data(client: FragmentClient) -> None:
@pytest.mark.asyncio
async def test_fragment_request_non_200_raises() -> None:
response = MagicMock(spec=httpx.Response)
response = MagicMock(spec=Response)
response.status_code = 429
session = AsyncMock(spec=httpx.AsyncClient)
session = AsyncMock(spec=AsyncSession)
session.post = AsyncMock(return_value=response)
with pytest.raises(FragmentPageError, match="429"):