jenkins-bot has submitted this change and it was merged.

Change subject: Split the allusers test into multiple tests
......................................................................


Split the allusers test into multiple tests

One part of the all users tests fail on 1.12-1.15; it should be
a separate test the other parts of the allusers test pass.

Bug: 72850
Change-Id: Ibe825cdc186becb083b2fbb45c02ce2db152bafb
---
M tests/site_tests.py
1 file changed, 14 insertions(+), 2 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/site_tests.py b/tests/site_tests.py
index 0c13092..df22137 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -486,7 +486,7 @@
 #            self.assertIsInstance(cat, pywikibot.Category)
 #            self.assertLessEqual(cat.title(withNamespace=False), "Hij")
 
-    def testAllUsers(self):
+    def test_allusers(self):
         """Test the site.allusers() method."""
         mysite = self.get_site()
         au = list(mysite.allusers(total=10))
@@ -496,19 +496,31 @@
             self.assertIn("name", user)
             self.assertIn("editcount", user)
             self.assertIn("registration", user)
+
+    def test_allusers_with_start(self):
+        """Test the site.allusers(start=..) method."""
+        mysite = self.get_site()
         for user in mysite.allusers(start="B", total=5):
             self.assertIsInstance(user, dict)
             self.assertIn("name", user)
             self.assertGreaterEqual(user["name"], "B")
             self.assertIn("editcount", user)
             self.assertIn("registration", user)
+
+    def test_allusers_with_prefix(self):
+        """Test the site.allusers(prefix=..) method."""
+        mysite = self.get_site()
         for user in mysite.allusers(prefix="C", total=5):
             self.assertIsInstance(user, dict)
             self.assertIn("name", user)
             self.assertTrue(user["name"].startswith("C"))
             self.assertIn("editcount", user)
             self.assertIn("registration", user)
-        for user in mysite.allusers(prefix="D", group="sysop", total=5):
+
+    def _test_allusers_with_group(self):
+        """Test the site.allusers(group=..) method."""
+        mysite = self.get_site()
+        for user in mysite.allusers(prefix="D", group="bot", total=5):
             self.assertIsInstance(user, dict)
             self.assertIn("name", user)
             self.assertTrue(user["name"].startswith("D"))

-- 
To view, visit https://gerrit.wikimedia.org/r/170514
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe825cdc186becb083b2fbb45c02ce2db152bafb
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to