-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LinksSpiderError and update tests #425
Conversation
kingfisher_scrapy/exceptions.py
Outdated
class LinksSpiderError(KingfisherScrapyError): | ||
"""Raised when a next link is invalid in LinksSpider""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use a more descriptive class name, since it's possible the LinksSpider will implement other exceptions in the future:
class LinksSpiderError(KingfisherScrapyError): | |
"""Raised when a next link is invalid in LinksSpider""" | |
class MissingNextLinkError(KingfisherScrapyError): | |
"""Raised when a next link is not found on the first page of results""" |
tests/test_links_spider.py
Outdated
|
||
with pytest.raises(KingfisherScrapyError) as e: | ||
assert spider.next_link(response_fixture(body='{"links": {"next": ""}}')) | ||
meta = {'file_name': 'test', 'depth': 0} | ||
assert spider.next_link(response_fixture(meta=meta, body=body)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove the assert
here.
closes #412