MCPcopy
hub / github.com/scrapy/scrapy / test_regex

Method test_regex

tests/test_contracts.py:473–486  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

471 assert message in self.results.failures[-1][-1]
472
473 def test_regex(self):
474 spider = DemoSpider()
475 response = ResponseMock()
476
477 # invalid regex
478 request = self.conman.from_method(spider.invalid_regex, self.results)
479 self.should_succeed()
480
481 # invalid regex with valid contract
482 request = self.conman.from_method(
483 spider.invalid_regex_with_valid_contract, self.results
484 )
485 self.should_succeed()
486 request.callback(response)
487
488 def test_custom_contracts(self):
489 self.conman.from_spider(CustomContractSuccessSpider(), self.results)

Callers

nothing calls this directly

Calls 5

should_succeedMethod · 0.95
DemoSpiderClass · 0.85
ResponseMockClass · 0.85
from_methodMethod · 0.80
callbackMethod · 0.80

Tested by

no test coverage detected