jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/676276 )
Change subject: [cleanup] Remove deprecated Page.fileUrl() ......................................................................
[cleanup] Remove deprecated Page.fileUrl()
- Page.fileUrl() is deprecated for 5 years. Remove it in favour of get_file_url() method. - remove file_tests.TestShareFiles.test_fileUrl_versus_get_file_url
Change-Id: I1050607d8d6c169faa5ef17330df36e320a3cc42 --- M pywikibot/page/__init__.py M tests/file_tests.py 2 files changed, 0 insertions(+), 15 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py index 1d3dea5..4b8b15e 100644 --- a/pywikibot/page/__init__.py +++ b/pywikibot/page/__init__.py @@ -2298,11 +2298,6 @@ self._imagePageHtml = http.request(self.site, path).text return self._imagePageHtml
- @deprecated('get_file_url', since='20160609', future_warning=True) - def fileUrl(self): # pragma: no cover - """Return the URL for the file described on this page.""" - return self.latest_file_info.url - def get_file_url(self, url_width=None, url_height=None, url_param=None) -> str: """ diff --git a/tests/file_tests.py b/tests/file_tests.py index 2834822..ef969b6 100644 --- a/tests/file_tests.py +++ b/tests/file_tests.py @@ -42,16 +42,6 @@
cached = True
- def test_fileUrl_versus_get_file_url(self): - """Test fileUrl() is equivalent to get_file_url().""" - title = 'File:Sepp Maier 1.JPG' - commons = self.get_site('commons') - commons_file = pywikibot.FilePage(commons, title) - self.assertEqual(commons_file.fileUrl(), commons_file.get_file_url()) - itwp = self.get_site('itwiki') - itwp_file = pywikibot.FilePage(itwp, title) - self.assertEqual(itwp_file.fileUrl(), itwp_file.get_file_url()) - def testSharedOnly(self): """Test file_is_shared() on file page with shared file only.""" title = 'File:Sepp Maier 1.JPG'
pywikibot-commits@lists.wikimedia.org