def test_create_crawler_mock(self, mock_crawler): create_crawler_object(self.spider, self.settings) mock_crawler.assert_called_with(self.settings)
def test_create_crawler_object(self): crwlr = create_crawler_object(self.spider, self.settings) self.assertIsInstance(crwlr, Crawler)
def test_create_crawler_mock(self): if SCRAPY_VERSION <= (1, 0, 0): with patch('arachne.scrapy_utils.Crawler') as mock_crawler: create_crawler_object(self.spider, self.settings) mock_crawler.assert_called_with(self.settings)
def test_create_crawler_object(self): if SCRAPY_VERSION <= (1, 0, 0): from scrapy.crawler import Crawler crwlr = create_crawler_object(self.spider, self.settings) self.assertIsInstance(crwlr, Crawler)