jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/773993 )

Change subject: [tests] Test Page.getOldVersion()
......................................................................

[tests] Test Page.getOldVersion()

Change-Id: Ib0d92753fc472d1da7893595c3bf30a01229f368
---
M tests/page_tests.py
1 file changed, 14 insertions(+), 0 deletions(-)

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



diff --git a/tests/page_tests.py b/tests/page_tests.py
index d6196ae..111ab62 100755
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -30,6 +30,7 @@
     TestCase,
     unittest,
 )
+from tests.utils import skipping


 EMPTY_TITLE_RE = r'Title must be specified and not empty if source is a Site\.'
@@ -281,6 +282,19 @@
         self.assertIsInstance(mainpage.oldest_revision.timestamp,
                               pywikibot.Timestamp)

+    def test_old_version(self):
+        """Test page.getOldVersion()."""
+        mainpage = self.get_mainpage()
+        revid = mainpage.oldest_revision.revid
+        self.assertIsNone(mainpage.oldest_revision.text)
+        self.assertIsNone(mainpage._revisions[revid].text)
+        text = mainpage.getOldVersion(revid)
+        self.assertEqual(
+            text[:53], "'''[[Welcome, newcomers|Welcome]] to [[Wikipedia]]'''")
+        self.assertEqual(text, mainpage._revisions[revid].text)
+        with skipping(AssertionError, msg='T304786'):
+            self.assertEqual(text, mainpage.oldest_revision.text)
+

 class TestPageObject(DefaultSiteTestCase):


--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/773993
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ib0d92753fc472d1da7893595c3bf30a01229f368
Gerrit-Change-Number: 773993
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to