rmax / scrapy-redis

Redis-based components for Scrapy.
http://scrapy-redis.readthedocs.io
MIT License
5.49k stars 1.59k forks source link

[dev] Add customize fingerprint #280

Closed LuckyPigeon closed 1 year ago

LuckyPigeon commented 1 year ago

Description

request_fingerprint is deprecated in Scrapy, but new fingerprint function requires a lot of changes of our code. Thus we need a customize fingerprint implementation for our own.

Unittests are also implemented, there are three new unittests

Fixes #272

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test Configuration:

Checklist:

LuckyPigeon commented 1 year ago

@rmax Do we need a unit test for this implementation? This function might not be called by others, right?

rmax commented 1 year ago

My suggestion would be to refactor the fingerprint method logic into a function and unit test the behavior of this function:

LuckyPigeon commented 1 year ago

Sounds great.

LuckyPigeon commented 1 year ago

@rmax done!