jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/854152 )

Change subject: [test] Fix User.usercontribs test
......................................................................

[test] Fix User.usercontribs test

Change-Id: I8c7ce01bc24bb637d72012412f6544ed7b323b37
---
M tests/user_tests.py
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/tests/user_tests.py b/tests/user_tests.py
index 2b35e1d..0488dca 100755
--- a/tests/user_tests.py
+++ b/tests/user_tests.py
@@ -175,13 +175,15 @@
         """Test the User.usercontribs() method."""
         mysite = self.get_site()
         user = User(mysite, mysite.user())
-        uc = list(user.contributions(total=10))
+        uc = list(user.contributions(total=50))
         if not uc:
             self.skipTest('User {} has no contributions on site {}.'
                           .format(mysite.user(), mysite))
         self.assertLessEqual(len(uc), 10)
         self.assertEqual(uc[0], user.last_edit)
-        self.assertEqual(uc[-1], user.first_edit)
+        first_edit = uc[-1] if len(uc) < 50 else list(
+            user.contributions(total=1, reverse=True))[0]
+        self.assertEqual(first_edit, user.first_edit)
         for contrib in uc:
             self.assertIsInstance(contrib, tuple)
             self.assertLength(contrib, 4)

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/854152
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8c7ce01bc24bb637d72012412f6544ed7b323b37
Gerrit-Change-Number: 854152
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to