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

Change subject: site_tests.py: skip deprecated patrol test if user is not 
allowed
......................................................................


site_tests.py: skip deprecated patrol test if user is not allowed

In TestSiteTokens.test_deprecated_token(), check if action 'patrol' is
allowed for user.

Bug:T85786
Change-Id: I07ff2f34515166a3aa4d12ebdb4d4372021ee366
---
M tests/site_tests.py
1 file changed, 8 insertions(+), 1 deletion(-)

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



diff --git a/tests/site_tests.py b/tests/site_tests.py
index 2fbe552..1781052 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1615,7 +1615,14 @@
 
     def test_deprecated_token(self):
         self.assertEqual(self.mysite.getToken(), self.mysite.tokens['edit'])
-        self.assertEqual(self.mysite.getPatrolToken(), 
self.mysite.tokens['patrol'])
+        try:
+            self.assertEqual(self.mysite.getPatrolToken(), 
self.mysite.tokens['patrol'])
+        except pywikibot.Error as error_msg:
+            self.assertRegex(
+                unicode(error_msg),
+                "Action '[a-z]+' is not allowed for user .* on .* wiki.")
+            # test __contains__
+            self.assertNotIn('patrol', self.mysite.tokens)
 
 
 class TestSiteExtensions(WikimediaDefaultSiteTestCase):

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

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

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

Reply via email to