hhursev / recipe-scrapers

Python package for scraping recipes data
MIT License
1.61k stars 505 forks source link

tests: allow legacy tests to check for expected headers #1016

Closed jayaddison closed 3 months ago

jayaddison commented 3 months ago

@Keyruu could you please take a look at this suggestion?

What I'd like to do here is to allow the tests to optionally expect specific header values from the scraper when it makes a request.

In the case of #1014 that would include the Accept-Language header, which should match the original HTML page. It may also include the Device-Type header (if that's required).

Keyruu commented 3 months ago

Yes this would be good to check Accept-Language and Device-Type for the Monsieur Cuisine scraper because both of those headers are needed for the request to work.

Keyruu commented 3 months ago

Looks good to me!

jayaddison commented 3 months ago

Thanks! I'll merge this first so that we can use the test functionality in your pull request.