Xqt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370663 )

Change subject: [bugfix] Maybe mainpage image does not exist
......................................................................

[bugfix] Maybe mainpage image does not exist

Ignore the test when the image is None

Change-Id: I9c1af39b1c1e82da58f78b1b4331411bc059a790
---
M tests/page_tests.py
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/63/370663/1

diff --git a/tests/page_tests.py b/tests/page_tests.py
index b4d9a5e..17c69ef 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -563,7 +563,10 @@
         if MediaWikiVersion(site.version()) < MediaWikiVersion('1.20'):
             self.assertRaises(NotImplementedError, mainpage.page_image)
         elif site.has_extension('PageImages'):
-            self.assertIsInstance(mainpage.page_image(), pywikibot.FilePage)
+            image = mainpage.page_image()
+            if image is not None:
+                self.assertIsInstance(mainpage.page_image(),
+                                      pywikibot.FilePage)
             # for file pages, the API should return the file itself
             self.assertEqual(image.page_image(), image)
         else:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c1af39b1c1e82da58f78b1b4331411bc059a790
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to