jenkins-bot has submitted this change and it was merged.
Change subject: Add doc_subpages to commons/wikidata families ......................................................................
Add doc_subpages to commons/wikidata families
Also updated related test.
Change-Id: I1655f6c9e6894fc053af9ee33b255287bbeb6b28 --- M pywikibot/families/commons_family.py M pywikibot/families/wikidata_family.py M tests/site_tests.py 3 files changed, 23 insertions(+), 6 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/families/commons_family.py b/pywikibot/families/commons_family.py index 17e9d9b..7eb670a 100644 --- a/pywikibot/families/commons_family.py +++ b/pywikibot/families/commons_family.py @@ -45,6 +45,11 @@ 'commons': u'Disambiguation' }
+ # Subpages for documentation. + self.doc_subpages = { + '_default': ((u'/doc', ), ['commons']), + } + def shared_data_repository(self, code, transcluded=False): """Return the shared data repository for this site.""" return ('wikidata', 'wikidata') diff --git a/pywikibot/families/wikidata_family.py b/pywikibot/families/wikidata_family.py index 14e8c35..1673439 100644 --- a/pywikibot/families/wikidata_family.py +++ b/pywikibot/families/wikidata_family.py @@ -22,6 +22,11 @@
self.interwiki_forward = 'wikipedia'
+ # Subpages for documentation. + self.doc_subpages = { + '_default': ((u'/doc', ), ['wikidata']), + } + def shared_data_repository(self, code, transcluded=False): """ Indicate Wikidata is both a repository and its own client. diff --git a/tests/site_tests.py b/tests/site_tests.py index 022a77f..90d4f9f 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -82,6 +82,16 @@ 'code': 'de', 'result': ('/Doku', '/Meta'), }, + 'commons': { + 'family': 'commons', + 'code': 'commons', + 'result': ('/doc', ), + }, + 'wikidata': { + 'family': 'wikidata', + 'code': 'wikidata', + 'result': ('/doc', ), + }, }
cached = True @@ -89,12 +99,9 @@ def testProperties(self): """Test cases for BaseSite properties.""" # Test doc_subpage property. - mysite = self.get_site('enwk') - self.assertEqual(mysite.doc_subpage, self.sites['enwk']['result']) - mysite = self.get_site('enws') - self.assertEqual(mysite.doc_subpage, self.sites['enws']['result']) - mysite = self.get_site('dews') - self.assertEqual(mysite.doc_subpage, self.sites['dews']['result']) + def test_properties(self, key): + mysite = self.get_site(key) + self.assertEqual(mysite.doc_subpage, self.sites[key]['result'])
class TestSiteObject(DefaultSiteTestCase):
pywikibot-commits@lists.wikimedia.org