XZise has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245141

Change subject: [FIX] proofreadpage_tests: Preserve page order
......................................................................

[FIX] proofreadpage_tests: Preserve page order

The test for redlinks in an index page have been added in f77fb56f but they
were using `dict.values` which is not stable and thus might change the order.

Change-Id: I4e9d9ac72ad034ed232f8c0338423c33a0123e85
---
M tests/proofreadpage_tests.py
1 file changed, 7 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/41/245141/1

diff --git a/tests/proofreadpage_tests.py b/tests/proofreadpage_tests.py
index 67927fd..25eaf4c 100644
--- a/tests/proofreadpage_tests.py
+++ b/tests/proofreadpage_tests.py
@@ -542,15 +542,16 @@
     cached = True
 
     with_redlink = {
-        'title': {'blue': 'Page:Pywikibot test page 1/1',
-                  'red': 'Page:Pywikibot test page 2/2',
-                  },
+        'title': ['Page:Pywikibot test page 1/1',
+                  'Page:Pywikibot test page 2/2',
+                  ],
+        'missing': 'Page:Pywikibot test page 2/2',
         'index': 'Index:Pywikibot test page 1'
     }
 
     def test_index_redlink(self):
         """Test index property with redlink."""
-        page = ProofreadPage(self.site, self.with_redlink['title']['red'])
+        page = ProofreadPage(self.site, self.with_redlink['missing'])
         index_page = IndexPage(self.site, self.with_redlink['index'])
         self.assertEqual(page.index, index_page)
 
@@ -558,7 +559,7 @@
         """Test IndexPage page get_page_number functions with redlinks."""
         index_page = IndexPage(self.site, self.with_redlink['index'])
 
-        for title in self.with_redlink['title'].values():
+        for title in self.with_redlink['title']:
             p = ProofreadPage(self.site, title)
             n = index_page.get_number(p)
             self.assertEqual(index_page.get_page(n), p)
@@ -567,7 +568,7 @@
         """Test Index page generator with redlinks."""
         index_page = IndexPage(self.site, self.with_redlink['index'])
         proofread_pages = [ProofreadPage(self.site, page_title) for
-                           page_title in self.with_redlink['title'].values()]
+                           page_title in self.with_redlink['title']]
 
         # Check start/end limits.
         self.assertRaises(ValueError, index_page.page_gen, -1, 2)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e9d9ac72ad034ed232f8c0338423c33a0123e85
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <commodorefabia...@gmx.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to