jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1097352?usp=email )
Change subject: tests: test TestInterwikidataBot.test_main for all sites
......................................................................
tests: test TestInterwikidataBot.test_main for all sites
Change-Id: I8fe175d80701003e12195aac0bbacb125165f0e4
---
M tests/interwikidata_tests.py
1 file changed, 8 insertions(+), 5 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/interwikidata_tests.py b/tests/interwikidata_tests.py
index 4780a65..51b0f1c 100755
--- a/tests/interwikidata_tests.py
+++ b/tests/interwikidata_tests.py
@@ -13,7 +13,7 @@
import pywikibot
from pywikibot import Link
from scripts import interwikidata
-from tests.aspects import SiteAttributeTestCase
+from tests.aspects import AlteredDefaultSiteTestCase, SiteAttributeTestCase
from tests.utils import empty_sites
@@ -34,7 +34,7 @@
return
-class TestInterwikidataBot(SiteAttributeTestCase):
+class TestInterwikidataBot(AlteredDefaultSiteTestCase, SiteAttributeTestCase):
"""Test Interwikidata."""
@@ -53,10 +53,13 @@
},
}
- def test_main(self):
+ def test_main(self, key):
"""Test main function interwikidata.py."""
- # The default site is used here
- if pywikibot.Site().has_data_repository:
+ site = self.get_site(key)
+ pywikibot.config.family = site.family
+ pywikibot.config.mylang = site.code
+
+ if site.has_data_repository:
with empty_sites():
# The main function return None.
self.assertIsNone(interwikidata.main())
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1097352?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8fe175d80701003e12195aac0bbacb125165f0e4
Gerrit-Change-Number: 1097352
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]