jenkins-bot has submitted this change and it was merged.

Change subject: Fix TestSiteInfo.test_properties_with_defaults
......................................................................


Fix TestSiteInfo.test_properties_with_defaults

siteinfo.get must be used to access defaults.
Also fix a code comment.

Change-Id: Icd3fb0bc3c562e08a6e1688d849c5f870dd41903
---
M tests/site_tests.py
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  XZise: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/site_tests.py b/tests/site_tests.py
index ae56705..76f1db3 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1793,15 +1793,17 @@
         """Test the siteinfo properties with defaults."""
         # This does not test that the defaults work correct,
         # unless the default site is a version needing these defaults
-        # 'fileextensions' introduced in v1.14:
+        # 'fileextensions' introduced in v1.15:
         self.assertIsInstance(self.site.siteinfo.get('fileextensions'), list)
         self.assertIn('fileextensions', self.site.siteinfo)
-        self.assertIn({'ext': 'png'}, self.site.siteinfo['fileextensions'])
+        fileextensions = self.site.siteinfo.get('fileextensions')
+        self.assertIn({'ext': 'png'}, fileextensions)
         # 'restrictions' introduced in v1.23:
         mysite = self.site
         self.assertIsInstance(mysite.siteinfo.get('restrictions'), dict)
         self.assertIn('restrictions', mysite.siteinfo)
-        self.assertIn('cascadinglevels', self.site.siteinfo['restrictions'])
+        restrictions = self.site.siteinfo.get('restrictions')
+        self.assertIn('cascadinglevels', restrictions)
 
     def test_no_cache(self):
         """Test siteinfo caching can be disabled."""

-- 
To view, visit https://gerrit.wikimedia.org/r/231466
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icd3fb0bc3c562e08a6e1688d849c5f870dd41903
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to