jenkins-bot has submitted this change and it was merged.
Change subject: Set DrySite Wiktionary case='case-sensitive' ......................................................................
Set DrySite Wiktionary case='case-sensitive'
After acf2280 updated Link to use namespace case attribute, DrySite emulation of Wiktionary needs to updated.
Bug: T95499 Change-Id: Ic116dc729cb8dd0674668a14af40cff9a0c07a89 --- M pywikibot/site.py M tests/utils.py 2 files changed, 7 insertions(+), 10 deletions(-)
Approvals: John Vandenberg: Looks good to me, but someone else must approve XZise: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index 552d80c..75c2bd8 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -367,9 +367,9 @@ self.canonical_name, self.aliases, kwargs)
@classmethod - def builtin_namespaces(cls, use_image_name=False): + def builtin_namespaces(cls, use_image_name=False, case='first-letter'): """Return a dict of the builtin namespaces.""" - return dict((i, cls(i, use_image_name=use_image_name, case='first-letter')) + return dict((i, cls(i, use_image_name=use_image_name, case=case)) for i in range(-2, 16))
@staticmethod diff --git a/tests/utils.py b/tests/utils.py index ae80633..782b08b 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -191,7 +191,11 @@ self._paraminfo = DryParamInfo() self._siteinfo = DummySiteinfo({}) self._siteinfo._cache['lang'] = (code, True) - self._namespaces = SelfCallDict(Namespace.builtin_namespaces()) + self._namespaces = SelfCallDict( + Namespace.builtin_namespaces( + case='case-sensitive' + if self.family.name == 'wiktionary' + else 'first-letter'))
def __repr__(self): """Override default so warnings and errors indicate test is dry.""" @@ -209,13 +213,6 @@ warn('%r returning version 1.24; override if unsuitable.' % self, DrySiteNote, stacklevel=2) return '1.24' - - def case(self): - """Return case-sensitive if wiktionary.""" - if self.family.name == 'wiktionary': - return 'case-sensitive' - else: - return 'first-letter'
def image_repository(self): """Return Site object for image repository e.g. commons."""
pywikibot-commits@lists.wikimedia.org