jenkins-bot has submitted this change and it was merged.
Change subject: Fix wikibase tests broken by wiki edit ......................................................................
Fix wikibase tests broken by wiki edit
wikibase:Q5296 English label has changed from 'Main Page' to 'Wikimedia main page'. Slightly adjust the logic so that either is acceptable.
The initial version of the wikibase tests included a minor code issue causing a test to be ineffective. In testWikibase, instead of exercising item2.labels, item.labels is exercised a second time. item2.getID does not cause get() to be called, so get() needs to be explicitly in the test sequence.
Change-Id: I75fa36c3b05ba8141c51ce19575b7667f408fd84 --- M tests/wikibase_tests.py 1 file changed, 3 insertions(+), 2 deletions(-)
Approvals: John Vandenberg: Looks good to me, but someone else must approve Ricordisamoa: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py index 223c5b3..ba91af6 100644 --- a/tests/wikibase_tests.py +++ b/tests/wikibase_tests.py @@ -42,13 +42,14 @@ self.assertEqual(item.getID(), 'Q5296') self.assertEqual(item.title(), 'Q5296') self.assertTrue('en' in item.labels) - self.assertEqual(item.labels['en'], 'Main Page') + self.assertTrue(item.labels['en'].lower().endswith('main page')) self.assertTrue('en' in item.aliases) self.assertTrue('HomePage' in item.aliases['en']) self.assertEqual(item.namespace(), 0) item2 = pywikibot.ItemPage(repo, 'q5296') self.assertEqual(item2.getID(), 'Q5296') - self.assertEqual(item.labels['en'], 'Main Page') + item2.get() + self.assertTrue(item2.labels['en'].lower().endswith('main page')) prop = pywikibot.PropertyPage(repo, 'Property:P21') self.assertEqual(prop.type, 'wikibase-item') self.assertEqual(prop.namespace(), 120)
pywikibot-commits@lists.wikimedia.org