jenkins-bot has submitted this change and it was merged.
Change subject: Skip search test for sites using Wikia Search
......................................................................
Skip search test for sites using Wikia Search
The search API module is disabled on Wikia sites.
The method they use to disable the search module
is not yet known.
Skip this test on any site that is using extension
Wikia Search, so that this test is still triggered on
any other site which has disabled the search module.
Bug: T77968
Change-Id: I1e55fbc8ec77fdaea51b9565078a28622c4a260a
---
M tests/site_tests.py
1 file changed, 3 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 406e969..71b2304 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -908,6 +908,9 @@
def testSearch(self):
"""Test the site.search() method."""
mysite = self.get_site()
+ if mysite.has_extension("Wikia Search"):
+ raise unittest.SkipTest(
+ 'The site %r does not use MediaWiki search' % mysite)
try:
se = list(mysite.search("wiki", total=100))
self.assertLessEqual(len(se), 100)
--
To view, visit https://gerrit.wikimedia.org/r/182359
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1e55fbc8ec77fdaea51b9565078a28622c4a260a
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Maverick <manpreetkaur9411(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Backward compatibility: re-enable "watch" parameter for mw < 1.16
......................................................................
Backward compatibility: re-enable "watch" parameter for mw < 1.16
"watch" and "unwatch" is deprecated since mw 1.16 and the new
behaviour is introduces in https://www.mediawiki.org/wiki/Special:Code/pywikipedia/8169
without backward compatibility. Re-enable the old api call for
older mw releases and warn operator with "Invalid watch value"
message if using new parameters for old mw release.
Change-Id: I0b03e077c5cf0798412f43d161bd643b2409f7a5
---
M pywikibot/site.py
1 file changed, 10 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 3628842..188272a 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3971,7 +3971,8 @@
to one of "watch", "unwatch", "preferences", "nochange":
* watch: add the page to the watchlist
* unwatch: remove the page from the watchlist
- * preferences: use the preference settings (Default)
+ The following settings are supported by mw >= 1.16 only
+ * preferences: use the preference settings (default)
* nochange: don't change the watchlist
@param bot: if True, mark edit with bot flag
@return: True if edit succeeded, False if it failed
@@ -4007,8 +4008,14 @@
params['createonly'] = ""
if nocreate:
params['nocreate'] = ""
- if watch in ["watch", "unwatch", "preferences", "nochange"]:
- params['watchlist'] = watch
+ watch_items = ["watch", "unwatch"]
+ if MediaWikiVersion(self.version()) >= MediaWikiVersion("1.16"):
+ watch_items += ["preferences", "nochange"]
+ if watch in watch_items:
+ if MediaWikiVersion(self.version()) >= MediaWikiVersion("1.16"):
+ params['watchlist'] = watch
+ else:
+ params[watch] = ""
elif watch:
pywikibot.warning(
u"editpage: Invalid watch value '%(watch)s' ignored."
--
To view, visit https://gerrit.wikimedia.org/r/144358
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0b03e077c5cf0798412f43d161bd643b2409f7a5
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: Russell Blau <russblau(a)imapmail.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Skip Token tests if user doesn't have rights"
......................................................................
Revert "Skip Token tests if user doesn't have rights"
As TokenWallet.__getitem__ has side effects and caches the
token if needed, a 'in' only checks if the token has been
cached (see also the docstring of TokenWallet.__contains__).
A test done before merging this has been able to execute
'test_token'
( https://travis-ci.org/wikimedia/pywikibot-core/jobs/45416313#L801 )
while a test with this merged in has skipped it
( https://travis-ci.org/wikimedia/pywikibot-core/jobs/45420743#L800 ).
This reverts commit affc77a480653aba1631b3c38cc5376390730579.
Change-Id: Ia229b6473b075dd3e8a17a48f9d054d0ec0977bc
---
M tests/site_tests.py
1 file changed, 0 insertions(+), 16 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index fa138bd..60bb7bb 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -53,10 +53,6 @@
mysite = self.get_site()
mainpage = self.get_mainpage()
ttype = "edit"
- if ttype not in mysite.tokens:
- raise unittest.SkipTest(
- "Action '%s' not allowed for user %s on wiki %s"
- % (ttype, mysite.user(), mysite))
try:
token = mysite.tokens[ttype]
except KeyError:
@@ -1164,11 +1160,6 @@
"""Test the site.patrol() method."""
mysite = self.get_site()
- if 'patrol' not in mysite.tokens:
- raise unittest.SkipTest(
- "Action patrol is not allowed for user {0} on wiki {1}"
- .format(mysite.user(), mysite))
-
rc = list(mysite.recentchanges(total=1))[0]
# site.patrol() needs params
@@ -1262,14 +1253,7 @@
raise unittest.SkipTest(
u'Site %s version %s is too low for this tests.'
% (self.mysite, self._version))
-
- if in_tested not in self.mysite.tokens:
- raise unittest.SkipTest(
- 'Action %s is not allowed for user %s on wiki %s.'
- % (in_tested, self.mysite.user(), self.mysite))
-
self.mysite.version = lambda: test_version
-
for ttype in ("edit", "move", additional_token):
try:
token = self.mysite.tokens[ttype]
--
To view, visit https://gerrit.wikimedia.org/r/182168
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia229b6473b075dd3e8a17a48f9d054d0ec0977bc
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>