jenkins-bot has submitted this change and it was merged.
Change subject: Disable test.wikidata tests due to server bug ......................................................................
Disable test.wikidata tests due to server bug
- ItemPage.save test is moved to edit_failure_tests - ItemPage.templatesWithParams test moved to disabled method - ItemPage.botMayEdit test method added, disabled
Change-Id: I1b5eb335ea41c1a434d7428ba7c949f27ddf0007 --- M tests/edit_failure_tests.py M tests/wikibase_tests.py 2 files changed, 34 insertions(+), 9 deletions(-)
Approvals: XZise: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/edit_failure_tests.py b/tests/edit_failure_tests.py index f1d2c91..1a11b33 100644 --- a/tests/edit_failure_tests.py +++ b/tests/edit_failure_tests.py @@ -20,10 +20,10 @@ SpamfilterError, OtherPageSaveError, ) -from tests.utils import SiteTestCase, unittest +from tests.aspects import unittest, TestCase, WikibaseTestCase
-class TestSaveFailure(SiteTestCase): +class TestSaveFailure(TestCase):
"""Test cases for edits which should fail to save."""
@@ -51,7 +51,7 @@ self.assertRaisesRegexp(OtherPageSaveError, 'nobots', page.save)
-class TestActionFailure(SiteTestCase): +class TestActionFailure(TestCase):
"""Test cases for actions which should fail to save."""
@@ -80,6 +80,22 @@ page_from, 'Main Page', 'test')
+class TestWikibaseSaveTest(WikibaseTestCase): + + """Test case for WikibasePage.save on Wikidata test site.""" + + family = 'wikidata' + code = 'test' + + write = True + + def test_itempage_save(self): + """Test ItemPage save method inherited from superclass Page.""" + repo = self.get_repo() + item = pywikibot.ItemPage(repo, 'Q6') + self.assertRaises(pywikibot.PageNotSaved, item.save) + + if __name__ == '__main__': try: unittest.main() diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py index 202ea6f..c436fd6 100644 --- a/tests/wikibase_tests.py +++ b/tests/wikibase_tests.py @@ -493,20 +493,29 @@
"""Test cases to test methods of Page() behave correctly with Wikibase."""
- family = 'wikidata' - code = 'test' - def test_page_methods(self): """Test ItemPage methods inherited from superclass Page.""" - wikidatatest = self.get_repo() - self.wdp = pywikibot.ItemPage(wikidatatest, 'Q6') - self.assertRaises(pywikibot.PageNotSaved, self.wdp.save) + self.wdp = pywikibot.ItemPage(self.get_repo(), 'Q60') self.wdp.previousRevision() self.assertEqual(self.wdp.langlinks(), []) self.assertEqual(self.wdp.templates(), []) self.assertFalse(self.wdp.isCategoryRedirect()) + + def __test_item_templates(self): + """Test templatesWithParams.""" + self.wdp = pywikibot.ItemPage(self.get_repo(), 'Q60') self.wdp.templatesWithParams()
+ def __test_item_bot_may_edit(self): + """Test botMayEdit.""" + site = self.get_site() + page = pywikibot.Page(site, 'Q60') + self.assertTrue(page.botMayEdit()) + + repo = self.get_repo() + item = pywikibot.ItemPage(repo, 'Q60') + self.assertTrue(item.botMayEdit()) +
class TestLinks(WikidataTestCase):
pywikibot-commits@lists.wikimedia.org