fix: str(value)

This commit is contained in:
yetval
2026-04-30 09:52:34 -04:00
parent a5a5652996
commit 334b0f5538
2 changed files with 26 additions and 1 deletions
+18
View File
@@ -106,6 +106,24 @@ class TestRequestProperties:
assert r1.update_fingerprint(include_kwargs=True) != r2.update_fingerprint(include_kwargs=True)
def test_fingerprint_include_kwargs_handles_non_primitive_values(self):
class _Opaque:
def __repr__(self) -> str:
return "_Opaque(stable)"
opaque = _Opaque()
r1 = Request("https://example.com", proxies={"http": "p1"}, custom=opaque)
r2 = Request("https://example.com", proxies={"http": "p1"}, custom=opaque)
r3 = Request("https://example.com", proxies={"http": "p2"}, custom=opaque)
fp1 = r1.update_fingerprint(include_kwargs=True)
r2._fp = None
fp2 = r2.update_fingerprint(include_kwargs=True)
fp3 = r3.update_fingerprint(include_kwargs=True)
assert fp1 == fp2
assert fp1 != fp3
def test_fingerprint_include_headers_preserves_header_value_case(self):
"""Test header values are fingerprinted without lowercasing."""
r1 = Request("https://example.com", headers={"X-Test": "A"})