jenkins-bot has submitted this change and it was merged.

Change subject: Fix tests after improvements in APISite.sametitle
......................................................................


Fix tests after improvements in APISite.sametitle

The preloading tests where written before APISite.sametitle
was improved, however they landed after the sametitle change.
As a result, most of the builds broke.

Change-Id: I3381d693fb3d03708bcb0218d0ad95d90f1f8002
---
M tests/site_tests.py
1 file changed, 6 insertions(+), 4 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, but someone else must approve
  Mpaa: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/site_tests.py b/tests/site_tests.py
index ca605d8..e738859 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1685,6 +1685,7 @@
         # preloadpages will send the page ids, as they have already been loaded
         # by pagelinks, and preloadpages should complain the returned titles
         # do not match any title in the pagelist.
+        # However, APISite.sametitle now correctly links them.
         for page in links:
             page._link._text += ' '
 
@@ -1693,8 +1694,8 @@
             self.assertIsInstance(page, pywikibot.Page)
             self.assertIsInstance(page.exists(), bool)
             if page.exists():
-                self.assertFalse(hasattr(page, "_text"))
-                self.assertEqual(len(page._revisions), 0)
+                self.assertTrue(hasattr(page, "_text"))
+                self.assertEqual(len(page._revisions), 1)
                 self.assertFalse(hasattr(page, '_pageprops'))
             count += 1
             if count > 5:
@@ -1712,6 +1713,7 @@
         # change the title of the page _and_ delete the pageids.
         # preloadpages can only send the titles, and preloadpages should
         # complain the returned titles do not match any title in the pagelist.
+        # However, APISite.sametitle now correctly links them.
         for page in links:
             page._link._text += ' '
             del page._pageid
@@ -1721,8 +1723,8 @@
             self.assertIsInstance(page, pywikibot.Page)
             self.assertIsInstance(page.exists(), bool)
             if page.exists():
-                self.assertFalse(hasattr(page, "_text"))
-                self.assertEqual(len(page._revisions), 0)
+                self.assertTrue(hasattr(page, "_text"))
+                self.assertEqual(len(page._revisions), 1)
                 self.assertFalse(hasattr(page, '_pageprops'))
             count += 1
             if count > 5:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3381d693fb3d03708bcb0218d0ad95d90f1f8002
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to