jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/343445 )
Change subject: [bugfix] Use default summary when summary value does not contain a string
......................................................................
[bugfix] Use default summary when summary value does not contain a string
Bug: T160823
Change-Id: I563b21216b2fb6ee46cdc52134ecabad14abfa19
---
M pywikibot/bot.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Lokal Profil: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index a5aba1b..1e0135a 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1699,7 +1699,7 @@
def put_current(self, *args, **kwargs):
"""Defining a summary if not already defined and then call original."""
- if 'summary' not in kwargs:
+ if not kwargs.get('summary'):
from pywikibot import i18n
if self.summary_key is None:
raise ValueError('The summary_key must be set.')
--
To view, visit https://gerrit.wikimedia.org/r/343445
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I563b21216b2fb6ee46cdc52134ecabad14abfa19
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Lokal Profil <lokal.profil(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/345373 )
Change subject: category_bot_tests: Temporarily set a fake username for BaseSite
......................................................................
category_bot_tests: Temporarily set a fake username for BaseSite
Temporarily patch BaseSite.username method to make it return a fake username.
This will help to circumvent NoUsername error during the initialization of
CategoryMoveRobot if there is no user name set for wikibase.
Bug: T161692
Change-Id: I08350274a6917496ab9b1850571f216428f6b164
---
M tests/category_bot_tests.py
1 file changed, 12 insertions(+), 0 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/category_bot_tests.py b/tests/category_bot_tests.py
index fd6d6ff..29dad8e 100644
--- a/tests/category_bot_tests.py
+++ b/tests/category_bot_tests.py
@@ -9,11 +9,23 @@
__version__ = '$Id$'
+try:
+ from unittest.mock import patch, Mock
+except ImportError:
+ from mock import patch, Mock
+
+from pywikibot import BaseSite
+
from scripts.category import CategoryMoveRobot
from tests.aspects import unittest, DefaultSiteTestCase
+MOCKED_USERNAME = Mock(return_value='FakeUsername')
+
+
+# Temporarily set a username to circumvent NoUsername error; T161692
+(a)patch.object(BaseSite, 'username', new=MOCKED_USERNAME)
class CfdActions(DefaultSiteTestCase):
"""Test CFD (Categories for deletion) actions."""
--
To view, visit https://gerrit.wikimedia.org/r/345373
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I08350274a6917496ab9b1850571f216428f6b164
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>