jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] ParamInfo: Only return action and query mods
......................................................................
[FIX] ParamInfo: Only return action and query mods
The ParamInfo.modules property before 6e1f3918 returned just action and query
modules. This is reverting the change in 6e1f3918 to that previous state.
Change-Id: Iaa0c3c3eccc17d11abb6366de12e650bea9fa992
---
M pywikibot/data/api.py
M tests/api_tests.py
2 files changed, 10 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index c0731eb..88701de 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -883,7 +883,7 @@
@deprecated('submodules() or module_paths')
def modules(self):
"""
- Set of all module names without path prefixes.
+ Set of all main and query modules without path prefixes.
Modules with the same names will be only added once (e.g. 'tokens' from
the action modules and query modules).
@@ -891,7 +891,7 @@
@return: module names
@rtype: set of str
"""
- return self._module_set(False)
+ return self.action_modules | self.query_modules
@property
def module_paths(self):
diff --git a/tests/api_tests.py b/tests/api_tests.py
index 9da7fb3..fdff58a 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -482,8 +482,16 @@
self.assertNotIn('flow', pi._modules)
pi.fetch(['flow'])
self.assertIn('flow', pi._modules)
+ other_modules = set()
for modules in pi._modules.values():
self.assertIsInstance(modules, frozenset)
+ other_modules |= modules
+
+ other_modules -= pi.action_modules
+ other_modules -= pi.query_modules
+ self.assertLessEqual(other_modules & pi.submodules('flow'),
+ pi.submodules('flow'))
+ self.assertFalse(other_modules & pi.modules)
class TestOptionSet(TestCase):
--
To view, visit
https://gerrit.wikimedia.org/r/224767
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa0c3c3eccc17d11abb6366de12e650bea9fa992
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 <>