Skip to content

🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev

tests: Update all tests according to new update

Karim shoaird6844232eb6d
diff --git a/tests/fetchers/async/test_camoufox_session.py b/tests/fetchers/async/test_camoufox_session.py
index a2e0075..2971488 100644
--- a/tests/fetchers/async/test_camoufox_session.py
+++ b/tests/fetchers/async/test_camoufox_session.py
@@ -4,7 +4,7 @@ import asyncio
import pytest_httpbin
-from scrapling.engines import AsyncStealthySession
+from scrapling.engines._browsers import AsyncStealthySession
@pytest_httpbin.use_class_based_httpbin
diff --git a/tests/fetchers/async/test_dynamic_session.py b/tests/fetchers/async/test_dynamic_session.py
index 24c6860..d7a4ea9 100644
--- a/tests/fetchers/async/test_dynamic_session.py
+++ b/tests/fetchers/async/test_dynamic_session.py
@@ -3,7 +3,7 @@ import asyncio
import pytest_httpbin
-from scrapling.engines import AsyncDynamicSession
+from scrapling.engines._browsers import AsyncDynamicSession
@pytest_httpbin.use_class_based_httpbin
diff --git a/tests/fetchers/test_response_handling.py b/tests/fetchers/test_response_handling.py
index 7ff0f18..4db96bf 100644
--- a/tests/fetchers/test_response_handling.py
+++ b/tests/fetchers/test_response_handling.py
@@ -1,8 +1,8 @@
from unittest.mock import Mock
from scrapling.parser import Selector
-from scrapling.engines.toolbelt import ResponseFactory, Response
from scrapling.engines.toolbelt.custom import ResponseEncoding
+from scrapling.engines.toolbelt.convertor import ResponseFactory, Response
class TestResponseFactory:
diff --git a/tests/fetchers/test_utils.py b/tests/fetchers/test_utils.py
index b787d36..4a1563c 100644
--- a/tests/fetchers/test_utils.py
+++ b/tests/fetchers/test_utils.py
@@ -4,7 +4,6 @@ from pathlib import Path
from scrapling.engines.toolbelt.custom import ResponseEncoding, StatusText, Response
from scrapling.engines.toolbelt.navigation import (
construct_proxy_dict,
- construct_cdp_url,
js_bypass_path
)
from scrapling.engines.toolbelt.fingerprints import (
@@ -216,43 +215,6 @@ class TestConstructProxyDict:
construct_proxy_dict({"invalid": "structure"})
-class TestConstructCdpUrl:
- """Test CDP URL construction"""
-
- def test_basic_cdp_url(self):
- """Test basic CDP URL"""
- result = construct_cdp_url("ws://localhost:9222/devtools/browser")
- assert result == "ws://localhost:9222/devtools/browser"
-
- def test_cdp_url_with_params(self):
- """Test CDP URL with query parameters"""
- params = {"timeout": "30000", "headless": "true"}
- result = construct_cdp_url("ws://localhost:9222/devtools/browser", params)
-
- assert "timeout=30000" in result
- assert "headless=true" in result
-
- def test_cdp_url_without_leading_slash(self):
- """Test CDP URL without a leading slash in the path"""
- with pytest.raises(ValueError):
- construct_cdp_url("ws://localhost:9222devtools/browser")
-
- def test_invalid_cdp_scheme(self):
- """Test invalid CDP URL scheme"""
- with pytest.raises(ValueError):
- construct_cdp_url("http://localhost:9222/devtools/browser")
-
- def test_invalid_cdp_netloc(self):
- """Test invalid CDP URL network location"""
- with pytest.raises(ValueError):
- construct_cdp_url("ws:///devtools/browser")
-
- def test_malformed_cdp_url(self):
- """Test malformed CDP URL"""
- with pytest.raises(ValueError):
- construct_cdp_url("not-a-url")
-
-
class TestJsBypassPath:
"""Test JavaScript bypass path utility"""