refactor(mcp)!: Cleaning and unifying functions to async
- `get()` now delegates to `bulk_get([url])[0]` (was a separate sync implementation) - `fetch()` now delegates to `bulk_fetch([url])[0]` (eliminated duplicate fetcher call) - `stealthy_fetch()` now delegates to `bulk_stealthy_fetch([url])[0]` (same) - Replaced 6x repeated `_content_translator(Convertor._extract_content(...), page)` with a single `_translate_response()` helper - Removed unused imports (`Fetcher`, `DynamicFetcher`, `StealthyFetcher`, `Generator`)
This commit is contained in:
@@ -16,9 +16,10 @@ class TestMCPServer:
|
||||
def server(self):
|
||||
return ScraplingMCPServer()
|
||||
|
||||
def test_get_tool(self, server, test_url):
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_tool(self, server, test_url):
|
||||
"""Test the get tool method"""
|
||||
result = server.get(url=test_url, extraction_type="markdown")
|
||||
result = await server.get(url=test_url, extraction_type="markdown")
|
||||
assert isinstance(result, ResponseModel)
|
||||
assert result.status == 200
|
||||
assert result.url == test_url
|
||||
|
||||
Reference in New Issue
Block a user