jenkins-bot has submitted this change and it was merged. Change subject: Re-enable allpages langlinks tests ......................................................................
Re-enable allpages langlinks tests A set of allpages tests have been commented out due to performing badly, in 2008. Of those, filtering for langlinks is now a database error which has been logged as T78276, and is marked as an allowed_failure due to it working correctly on very small sites. The other commented out test filters for no langlinks and now works well. Change-Id: I62e3adadf24c8dc53e548376d59a2924858be615 --- M tests/site_tests.py 1 file changed, 24 insertions(+), 9 deletions(-) Approvals: John Vandenberg: Looks good to me, but someone else must approve Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/site_tests.py b/tests/site_tests.py index f0e8468..b7e2280 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -367,7 +367,7 @@ self.assertTrue(all(isinstance(el, basestring) for el in mysite.page_extlinks(mainpage))) - def testAllPages(self): + def test_allpages(self): """Test the site.allpages() method.""" mysite = self.get_site() fwd = list(mysite.allpages(total=10)) @@ -407,14 +407,26 @@ self.assertTrue(mysite.page_exists(page)) self.assertEqual(page.namespace(), 0) self.assertFalse(page.isRedirectPage()) -# for page in mysite.allpages(filterlanglinks=True, total=5): -# self.assertIsInstance(page, pywikibot.Page) -# self.assertTrue(mysite.page_exists(page)) -# self.assertEqual(page.namespace(), 0) -# for page in mysite.allpages(filterlanglinks=False, total=5): -# self.assertIsInstance(page, pywikibot.Page) -# self.assertTrue(mysite.page_exists(page)) -# self.assertEqual(page.namespace(), 0) + + @allowed_failure # T78276 + def test_allpages_langlinks_enabled(self): + mysite = self.get_site() + for page in mysite.allpages(filterlanglinks=True, total=5): + self.assertIsInstance(page, pywikibot.Page) + self.assertTrue(mysite.page_exists(page)) + self.assertEqual(page.namespace(), 0) + self.assertNotEqual(page.langlinks(), []) + + def test_allpages_langlinks_disabled(self): + mysite = self.get_site() + for page in mysite.allpages(filterlanglinks=False, total=5): + self.assertIsInstance(page, pywikibot.Page) + self.assertTrue(mysite.page_exists(page)) + self.assertEqual(page.namespace(), 0) + self.assertEqual(page.langlinks(), []) + + def test_allpages_pagesize(self): + mysite = self.get_site() for page in mysite.allpages(minsize=100, total=5): self.assertIsInstance(page, pywikibot.Page) self.assertTrue(mysite.page_exists(page)) @@ -427,6 +439,9 @@ % page) continue self.assertLessEqual(len(page.text), 200) + + def test_allpages_protection(self): + mysite = self.get_site() for page in mysite.allpages(protect_type="edit", total=5): self.assertIsInstance(page, pywikibot.Page) self.assertTrue(mysite.page_exists(page)) -- To view, visit https://gerrit.wikimedia.org/r/179148 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I62e3adadf24c8dc53e548376d59a2924858be615 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: John Vandenberg <jay...@gmail.com> Gerrit-Reviewer: John Vandenberg <jay...@gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ Pywikibot-commits mailing list Pywikibot-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits