Skip to content

Commit

Permalink
fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnzZ committed Jan 31, 2024
1 parent e766bc4 commit e3548ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/templates/e-commerce.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ Parameters

.. autoenum:: zyte_spider_templates.spiders.ecommerce.EcommerceCrawlStrategy

.. autoenum:: zyte_spider_templates.spiders.ecommerce.ExtractFrom
.. autoenum:: zyte_spider_templates.spiders.base.ExtractFrom

.. autoenum:: zyte_spider_templates.spiders.base.Geolocation
6 changes: 3 additions & 3 deletions tests/pages/test_product_navigation_heuristics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest
from pytest_twisted import ensureDeferred
from web_poet import HttpResponse, PageParams, RequestUrl
from web_poet import AnyResponse, HttpResponse, PageParams, RequestUrl
from zyte_common_items import ProbabilityRequest, ProductNavigation

from zyte_spider_templates.pages.product_navigation_heuristics import (
Expand Down Expand Up @@ -38,7 +38,7 @@ async def test_unknown_product_page():
</body>
</html>
"""
response = HttpResponse("https://example.com", body)
response = AnyResponse(HttpResponse("https://example.com", body))
navigation = ProductNavigation.from_dict(
{
"url": "https://example.com",
Expand Down Expand Up @@ -118,7 +118,7 @@ async def test_crawl_nofollow_links():
</html>
"""
url = "https://example.com"
response = HttpResponse(url, body)
response = AnyResponse(HttpResponse(url, body))
request_url = RequestUrl(response.url)
navigation = ProductNavigation(url=url)

Expand Down
4 changes: 3 additions & 1 deletion zyte_spider_templates/pages/product_navigation_heuristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def _probably_category_links(self) -> List[ProbabilityRequest]:
ignore_urls = set(self._urls_for_category())

links = []
response = TextResponse(url=str(self.response.url), body=self.response.text.encode())
response = TextResponse(
url=str(self.response.url), body=self.response.text.encode()
)
for link in link_extractor.extract_links(response):
if link.url in ignore_urls:
continue
Expand Down

0 comments on commit e3548ec

Please sign in to comment.