jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/693501 )
Change subject: [cleanup] Remove deprecated BaseSite namespace shortcuts ......................................................................
[cleanup] Remove deprecated BaseSite namespace shortcuts
Change-Id: I0484777253b397506f684d00f9319e636404e4e9 --- M pywikibot/site/_basesite.py M tests/site_tests.py 2 files changed, 0 insertions(+), 46 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py index eecc0d9..d462376 100644 --- a/pywikibot/site/_basesite.py +++ b/pywikibot/site/_basesite.py @@ -22,7 +22,6 @@ from pywikibot.tools import ( ComparableMixin, SelfCallString, - deprecated, first_upper, normalize_username, remove_last_args, @@ -408,39 +407,6 @@ name2 = first_upper(name2) return name1 == name2
- # namespace shortcuts for backwards-compatibility - - @deprecated('namespaces.SPECIAL.custom_name', since='20160407') - def special_namespace(self): - """Return local name for the Special: namespace.""" - return self.namespace(-1) - - @deprecated('namespaces.FILE.custom_name', since='20160407') - def image_namespace(self): - """Return local name for the File namespace.""" - return self.namespace(6) - - @deprecated('namespaces.MEDIAWIKI.custom_name', since='20160407') - def mediawiki_namespace(self): - """Return local name for the MediaWiki namespace.""" - return self.namespace(8) - - @deprecated('namespaces.TEMPLATE.custom_name', since='20160407') - def template_namespace(self): - """Return local name for the Template namespace.""" - return self.namespace(10) - - @deprecated('namespaces.CATEGORY.custom_name', since='20160407') - def category_namespace(self): - """Return local name for the Category namespace.""" - return self.namespace(14) - - @deprecated('list(namespaces.CATEGORY)', since='20150829', - future_warning=True) - def category_namespaces(self): # pragma: no cover - """Return names for the Category namespace.""" - return list(self.namespace(14, all=True)) - # site-specific formatting preferences
def category_on_one_line(self): diff --git a/tests/site_tests.py b/tests/site_tests.py index d4b2721..94c1067 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -85,18 +85,6 @@ self.assertFalse(page.isRedirectPage()) self.assertOneDeprecation()
- def test_namespace_shortcuts(self): - """Test namespace shortcuts.""" - self.assertEqual(self.site.image_namespace(), self.site.namespace(6)) - self.assertEqual(self.site.mediawiki_namespace(), - self.site.namespace(8)) - self.assertEqual(self.site.template_namespace(), - self.site.namespace(10)) - self.assertEqual(self.site.category_namespace(), - self.site.namespace(14)) - self.assertEqual(self.site.category_namespaces(), - list(self.site.namespace(14, all=True))) -
class TestSiteDryDeprecatedFunctions(DefaultDrySiteTestCase, DeprecationTestCase):
pywikibot-commits@lists.wikimedia.org