def test_no_meta(self): self.mocked_fetch_meta.side_effect = None start_crawl(self.fp.id) fp = FeaturePage.objects.get(id=self.fp.id) self.assertEqual(fp.STATUS_META, fp.status) self.mocked_fetch_meta.assert_called_once_with(fp.id)
def test_no_meta(self): self.mocked_fetch_meta.side_effect = None start_crawl(self.fp.id) fp = FeaturePage.objects.get(id=self.fp.id) self.assertEqual(fp.STATUS_META, fp.status) self.mocked_fetch_meta.assertCalledOnce(fp.id)
def test_meta_fetching(self): meta = self.fp.meta() meta.status = meta.STATUS_FETCHING meta.save() start_crawl(self.fp.id) fp = FeaturePage.objects.get(id=self.fp.id) self.assertEqual(fp.STATUS_META, fp.status)
def test_meta_error(self): meta = self.fp.meta() meta.status = meta.STATUS_ERROR meta.raw = 'META ERROR' meta.save() start_crawl(self.fp.id) fp = FeaturePage.objects.get(id=self.fp.id) self.assertEqual(fp.STATUS_ERROR, fp.status)
def test_meta_error(self): meta = self.fp.meta() meta.status = meta.STATUS_ERROR meta.raw = "META ERROR" meta.save() start_crawl(self.fp.id) fp = FeaturePage.objects.get(id=self.fp.id) self.assertEqual(fp.STATUS_ERROR, fp.status)
def test_meta_fetched(self): meta = self.fp.meta() meta.status = meta.STATUS_FETCHED meta.save() self.mocked_fetch_all.side_effect = None start_crawl(self.fp.id) fp = FeaturePage.objects.get(id=self.fp.id) self.assertEqual(fp.STATUS_PAGES, fp.status) self.mocked_fetch_all.assert_called_once_with(fp.id)
def test_meta_fetched(self): meta = self.fp.meta() meta.status = meta.STATUS_FETCHED meta.save() self.mocked_fetch_all.side_effect = None start_crawl(self.fp.id) fp = FeaturePage.objects.get(id=self.fp.id) self.assertEqual(fp.STATUS_PAGES, fp.status) self.mocked_fetch_all.assertCalledOnce(fp.id)