jenkins-bot has submitted this change and it was merged.
Change subject: Hostname support for WikimediaDefaultSiteTestCase
......................................................................
Hostname support for WikimediaDefaultSiteTestCase
The test framework now expects a hostname for each site, so
it can verify the site is working before running tests.
That feature fails on WikimediaDefaultSiteTestCase, as it
changes the sites object after the main initialisation code
has been completed. Add the hostname manually.
Change-Id: I6abb60697dacef698daa03b684e48f8088e52255
---
M tests/aspects.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py
index 3c1a190..8e82b55 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -901,7 +901,8 @@
cls.site: {
'family': 'wikipedia',
'code': 'en',
- 'site': cls.site
+ 'site': cls.site,
+ 'hostname': cls.site.hostname(),
}
}
--
To view, visit https://gerrit.wikimedia.org/r/180031
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6abb60697dacef698daa03b684e48f8088e52255
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
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: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #1824
Status: Fixed
Duration: 40 minutes and 56 seconds
Commit: 398e7a8 (master)
Author: Fabian Neundorf
Message: [IMPROV] Site: Also deprecate getFilesFromAnHash
This deprecates the getFilesFromAnHash method too because it's not
PEP8-compliant and APISite.allimages provides the same functionality
including being more flexible.
Change-Id: Ia37b18dc0c587071ea3b0bf5a3ebee7ae2d01504
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/2ac9d82401a5...398e7a8d…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/44647652
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] Site: Also deprecate getFilesFromAnHash
......................................................................
[IMPROV] Site: Also deprecate getFilesFromAnHash
This deprecates the getFilesFromAnHash method too because it's not
PEP8-compliant and APISite.allimages provides the same functionality
including being more flexible.
Change-Id: Ia37b18dc0c587071ea3b0bf5a3ebee7ae2d01504
---
M pywikibot/site.py
1 file changed, 23 insertions(+), 13 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 8f82568..b1e9c7d 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -4404,25 +4404,35 @@
"""Backwards-compatible interface to exturlusage()."""
return self.exturlusage(siteurl, total=limit)
- def getFilesFromAnHash(self, hash_found=None):
- """Return all images that have the same hash.
-
- Useful to find duplicates or nowcommons.
-
- NOTE: it returns also the image itself, if you don't want it, just
- filter the list returned.
-
- NOTE 2: it returns the image title WITHOUT the image namespace.
-
- """
+ def _get_titles_with_hash(self, hash_found=None):
+ """Helper for the deprecated method get(Files|Images)FromAnHash."""
+ # This should be removed with together with get(Files|Images)FromHash
if hash_found is None:
+ # This makes absolutely NO sense.
+ pywikibot.warning(
+ 'The "hash_found" parameter in "getFilesFromAnHash" and '
+ '"getImagesFromAnHash" are not optional.')
return
return [image.title(withNamespace=False)
for image in self.allimages(sha1=hash_found)]
- @deprecated('Site().getFilesFromAnHash')
+ @deprecated('Site().allimages')
+ def getFilesFromAnHash(self, hash_found=None):
+ """
+ Return all files that have the same hash.
+
+ DEPRECATED: Use L{APISite.allimages} instead using 'sha1'.
+ """
+ return self._get_titles_with_hash(hash_found)
+
+ @deprecated('Site().allimages')
def getImagesFromAnHash(self, hash_found=None):
- return self.getFilesFromAnHash(hash_found)
+ """
+ Return all images that have the same hash.
+
+ DEPRECATED: Use L{APISite.allimages} instead using 'sha1'.
+ """
+ return self._get_titles_with_hash(hash_found)
@must_be(group='user')
def is_uploaddisabled(self):
--
To view, visit https://gerrit.wikimedia.org/r/181076
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia37b18dc0c587071ea3b0bf5a3ebee7ae2d01504
Gerrit-PatchSet: 2
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 <>