Skip to content

Commit

Permalink
test spiders
Browse files Browse the repository at this point in the history
  • Loading branch information
aliavni committed Apr 23, 2024
1 parent 7c8603a commit 1bfa763
Show file tree
Hide file tree
Showing 10 changed files with 1,399 additions and 13 deletions.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[tool.coverage.run]
omit = ["settings.py"]

[tool.coverage.report]
include_namespace_packages = true
skip_covered = true
show_missing = true

[tool.bandit]
exclude_dirs = ["tests"]
2 changes: 0 additions & 2 deletions scrapers/common/utils.py

This file was deleted.

12 changes: 1 addition & 11 deletions scrapers/fifty_a/fifty_a/spiders/officer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,12 @@ class OfficerSpider(CrawlSpider):
)

def parse_officer(self, response):
"""
badge = response.css('.badge::text').get()
description = response.xpath("//span[contains(@class, 'desc')]/text()").get()
"""

complaints = self.parse_complaints(response)

officer = OfficerItem(
url=response.url,
name=response.css("h1::text").get(),
badge=response.css(".badge::text").get(),
description=response.xpath("//span[contains(@class, 'desc')]/text()").get(),
complaints=complaints,
complaints=self.parse_complaints(response),
)

yield officer
Expand All @@ -51,6 +44,3 @@ def parse_complaints(response) -> List[Optional[Dict[str, Any]]]:
name = disp.css(".name::text").get()
complaints.append({"name": name, "count": count_parsed})
return complaints

def parse(self, response):
pass
Empty file added tests/fifty_a/__init__.py
Empty file.
Empty file.
Empty file.
561 changes: 561 additions & 0 deletions tests/fifty_a/fifty_a/spiders/commands_page.py

Large diffs are not rendered by default.

Loading

0 comments on commit 1bfa763

Please sign in to comment.