def test_crawl(self): TestSpider.url = self.server.get_url() self.server.response['data'] = b'1' SPIDER_REGISTRY.clear() crawl.main('test_spider', settings_module='test.files.crawl_settings', disable_report=True) self.assertEquals(TestSpider.points, [b'1'])
def test_load_spider_class(self): cfg = self.build_config(['test.util_module']) SPIDER_REGISTRY.clear() cls = load_spider_class(cfg, 'first_spider') self.assertEqual(cls, FirstSpider)
def test_crawl_save_lists(self): FailSpider.url = self.server.get_url() self.server.response['data'] = b'1' SPIDER_REGISTRY.clear() crawl.main('fail_spider', settings_module='test.files.crawl_settings')