Discussion:
[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Provide Test for site.botusers() method #GCI2017
Anpans (Code Review)
2017-12-30 14:15:53 UTC
Permalink
Anpans has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/401083 )

Change subject: Provide Test for site.botusers() method #GCI2017
......................................................................

Provide Test for site.botusers() method #GCI2017

Change-Id: I066eecb25358ae054d7abc925574550153a83a6a
---
M tests/site_tests.py
1 file changed, 12 insertions(+), 0 deletions(-)


git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/83/401083/1

diff --git a/tests/site_tests.py b/tests/site_tests.py
index bd77485..2ff87e5 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -749,6 +749,18 @@
self.assertIsInstance(cat, pywikibot.Category)
self.assertLessEqual(cat.title(withNamespace=False), "Hij")

+ def test_botusers(self):
+ """Test the site.botusers() method."""
+ mysite = self.get_site()
+ bu = list(mysite.botusers(total=10))
+ self.assertLessEqual(len(bu), 10)
+ for botuser in bu:
+ self.assertIsInstance(botuser, dict)
+ self.assertIn("name", botuser)
+ self.assertIn("userid", botuser)
+ self.assertIn("editcount", botuser)
+ self.assertIn("registration", botuser)
+
def test_allusers(self):
"""Test the site.allusers() method."""
mysite = self.get_site()
--
To view, visit https://gerrit.wikimedia.org/r/401083
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I066eecb25358ae054d7abc925574550153a83a6a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Anpans <***@gmail.com>
jenkins-bot (Code Review)
2017-12-31 13:07:38 UTC
Permalink
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/401083 )

Change subject: [TEST] Add Test for site.botusers() method
......................................................................


[TEST] Add Test for site.botusers() method

Added test for the site.botusers() method, as my GCI task.

Bug: T60941
Change-Id: I066eecb25358ae054d7abc925574550153a83a6a
---
M tests/site_tests.py
1 file changed, 12 insertions(+), 0 deletions(-)

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



diff --git a/tests/site_tests.py b/tests/site_tests.py
index bd77485..b0f7287 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -749,6 +749,18 @@
self.assertIsInstance(cat, pywikibot.Category)
self.assertLessEqual(cat.title(withNamespace=False), "Hij")

+ def test_botusers(self):
+ """Test the site.botusers() method."""
+ mysite = self.get_site()
+ bu = list(mysite.botusers(total=10))
+ self.assertLessEqual(len(bu), 10)
+ for botuser in bu:
+ self.assertIsInstance(botuser, dict)
+ self.assertIn('name', botuser)
+ self.assertIn('userid', botuser)
+ self.assertIn('editcount', botuser)
+ self.assertIn('registration', botuser)
+
def test_allusers(self):
"""Test the site.allusers() method."""
mysite = self.get_site()
--
To view, visit https://gerrit.wikimedia.org/r/401083
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I066eecb25358ae054d7abc925574550153a83a6a
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Anpans <***@gmail.com>
Gerrit-Reviewer: Anpans <***@gmail.com>
Gerrit-Reviewer: Framawiki <***@tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <***@gmail.com>
Gerrit-Reviewer: Xqt <***@gno.de>
Gerrit-Reviewer: Zoranzoki21 <***@gmail.com>
Gerrit-Reviewer: jenkins-bot <>
Loading...