jenkins-bot has submitted this change and it was merged.
Change subject: Fix flow tests
......................................................................
Fix flow tests
mediawiki 'Talk:Sandbox' was moved to 'Project talk:Sandbox/Flow test'
and the current revision now has a parent_id.
Change-Id: Icf3c5fc1e5d2fe7e4706b9e113ad660cff3b1c1d
---
M tests/flow_tests.py
1 file changed, 16 insertions(+), 20 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/flow_tests.py b/tests/flow_tests.py
index cf76536..fc24841 100644
--- a/tests/flow_tests.py
+++ b/tests/flow_tests.py
@@ -22,24 +22,30 @@
)
-class TestBoardBasePageMethods(BasePageMethodsTestBase):
+class TestMediaWikiFlowSandbox(TestCase):
- """Test Flow board pages using BasePage-defined
methods."""
+ """Test the Flow sandbox on MediaWiki.org."""
family = 'mediawiki'
code = 'mediawiki'
def setUp(self):
"""Set up unit test."""
- self._page = Board(self.site, 'Talk:Sandbox')
- super(TestBoardBasePageMethods, self).setUp()
+ self._page = Board(self.site, 'Project_talk:Sandbox/Flow test')
+ super(TestMediaWikiFlowSandbox, self).setUp()
+
+
+class TestBoardBasePageMethods(BasePageMethodsTestBase,
+ TestMediaWikiFlowSandbox):
+
+ """Test Flow board pages using BasePage-defined
methods."""
def test_basepage_methods(self):
"""Test basic Page methods on a Flow board
page."""
self._test_invoke()
self._test_return_datatypes()
self.assertFalse(self._page.isRedirectPage())
- self.assertEqual(self._page.latest_revision.parent_id, 0)
+ self.assertGreater(self._page.latest_revision.parent_id, 0)
def test_content_model(self):
"""Test Flow page content model."""
@@ -70,17 +76,10 @@
self.assertEqual(self._page.content_model, 'flow-board')
-class TestLoadRevisionsCaching(BasePageLoadRevisionsCachingTestBase):
+class TestLoadRevisionsCaching(BasePageLoadRevisionsCachingTestBase,
+ TestMediaWikiFlowSandbox):
"""Test site.loadrevisions() caching."""
-
- family = 'mediawiki'
- code = 'mediawiki'
-
- def setUp(self):
- """Set up unit test."""
- self._page = Board(self.site, 'Talk:Sandbox')
- super(TestLoadRevisionsCaching, self).setUp()
def test_page_text(self):
"""Test site.loadrevisions() with Page.text."""
@@ -88,18 +87,15 @@
self._test_page_text()
-class TestFlowLoading(TestCase):
+class TestFlowLoading(TestMediaWikiFlowSandbox):
"""Test loading of Flow objects from the API."""
-
- family = 'mediawiki'
- code = 'mediawiki'
cached = True
def test_board_uuid(self):
"""Test retrieval of Flow board UUID."""
- board = Board(self.site, 'Talk:Sandbox')
+ board = self._page
self.assertEqual(board.uuid, 'rl7iby6wgksbpfno')
def test_topic_uuid(self):
@@ -150,7 +146,7 @@
def test_topiclist(self):
"""Test loading of topiclist."""
- board = Board(self.site, 'Talk:Sandbox')
+ board = self._page
i = 0
for topic in board.topics(limit=7):
i += 1
--
To view, visit
https://gerrit.wikimedia.org/r/291713
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icf3c5fc1e5d2fe7e4706b9e113ad660cff3b1c1d
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>