Skip to content

Commit

Permalink
Update import for fingerprint to work with new version of Scrapy
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Azil committed Jan 8, 2025
1 parent 53323bf commit 1eeb4ad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest
import scrapy
from scrapy.utils.request import request_fingerprint
from scrapy.utils.request import fingerprint

from scrapy_splash import SplashRequest
from scrapy_splash.dupefilter import splash_request_fingerprint
Expand Down Expand Up @@ -48,9 +48,9 @@ def test_dict_hash_invalid():
def test_request_fingerprint_nosplash():
r1 = scrapy.Request("http://example.com")
r2 = scrapy.Request("http://example.com", meta={"foo": "bar"})
assert request_fingerprint(r1) == splash_request_fingerprint(r1)
assert request_fingerprint(r1) == request_fingerprint(r2)
assert request_fingerprint(r1) == splash_request_fingerprint(r2)
assert fingerprint(r1) == splash_request_fingerprint(r1)
assert fingerprint(r1) == fingerprint(r2)
assert fingerprint(r1) == splash_request_fingerprint(r2)


def assert_fingerprints_match(r1, r2):
Expand All @@ -68,7 +68,7 @@ def test_request_fingerprint_splash():
r4 = scrapy.Request("http://example.com", meta={"foo": "bar", "splash": {"args": {"html": 1}}})
r5 = scrapy.Request("http://example.com", meta={"splash": {"args": {"html": 1, "wait": 1.0}}})

assert request_fingerprint(r1) == request_fingerprint(r2)
assert fingerprint(r1) == fingerprint(r2)
assert_fingerprints_dont_match(r1, r2)
assert_fingerprints_dont_match(r1, r3)
assert_fingerprints_dont_match(r1, r4)
Expand Down

0 comments on commit 1eeb4ad

Please sign in to comment.