tests: Multiple changes to tests

- Remove all tests for the old encoding logic
- Stop using the `nopecha` test page to test Cloudflare solver
- Remove useless tests like testing for infinite timeout
- Fixes to make the code compatible with new changes
This commit is contained in:
Karim shoair
2025-09-14 20:24:46 +03:00
parent ce4fc31f2c
commit eae088a07b
7 changed files with 5 additions and 45 deletions
-15
View File
@@ -1,7 +1,6 @@
from unittest.mock import Mock
from scrapling.parser import Selector
from scrapling.engines.toolbelt.custom import ResponseEncoding
from scrapling.engines.toolbelt.convertor import ResponseFactory, Response
@@ -32,20 +31,6 @@ class TestResponseFactory:
assert response.url == "https://example.com"
assert isinstance(response, Response)
def test_response_encoding_edge_cases(self):
"""Test response encoding handling"""
# Test various content types
test_cases = [
(None, "utf-8"),
("", "utf-8"),
("text/html; charset=invalid", "utf-8"),
("application/octet-stream", "utf-8"),
]
for content_type, expected in test_cases:
encoding = ResponseEncoding.get_value(content_type)
assert encoding == expected
def test_response_history_processing(self):
"""Test processing response history"""
# Mock responses with redirects