def test_crawl_passes_crawljob_to_work_service(self): crawler = Crawler() crawler.crawl("bar") self.assertEqual( Inject.features['work_service'].request_work.call_count(), 1) job = Inject.features['work_service'].request_work.calls[0][0][0] self.assertTrue(callable(job))
def test_crawl_calls_on_start(self): crawler = Crawler() callback = CallableMock() crawler.on_start(callback) crawler.crawl("foo") self.assertEqual(callback.call_count(), 1)