jenkins-bot has submitted this change and it was merged. Change subject: proofreadpage_tests.py: remove duplicated code ......................................................................
proofreadpage_tests.py: remove duplicated code Remove duplicate code of test_get_labels(), left in code by mistake. Moved a comment present in duplicated code to test_get_labels(). Change-Id: I8cc7383399f47710aec38a692cf0ea775205d12e --- M tests/proofreadpage_tests.py 1 file changed, 1 insertion(+), 20 deletions(-) Approvals: XZise: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/proofreadpage_tests.py b/tests/proofreadpage_tests.py index 8a1715f..33d67d5 100644 --- a/tests/proofreadpage_tests.py +++ b/tests/proofreadpage_tests.py @@ -345,11 +345,11 @@ # Get label from number. self.assertEqual(index_page.get_label_from_page_number(num), label) + # Error if number does not exists. self.assertRaises(KeyError, index_page.get_label_from_page_number, -1) # Get label from page. self.assertEqual(index_page.get_label_from_page(proofread_page), label) - # Error if page does not exists. self.assertRaises(KeyError, index_page.get_label_from_page, None) @@ -395,25 +395,6 @@ for n in num_set: p = index_page.get_page_from_number(n) self.assertEqual(index_page._numbers_from_page[p], n) - - def test_page_number_mapping(self, key): - """Test consistency of page <-> mapping.""" - data = self.sites[key] - num, title_num, label = data['get_label'] - - index_page = IndexPage(self.site, self.sites[key]['index']) - page_title = self.sites[key]['page'].format(title_num) - proofread_page = ProofreadPage(self.site, page_title) - - # Get label from number. - self.assertEqual(index_page.get_label_from_page_number(num), label) - # Error if number does not exists. - self.assertRaises(KeyError, index_page.get_label_from_page_number, -1) - - # Get label from page. - self.assertEqual(index_page.get_label_from_page(proofread_page), label) - # Error if page does not exists. - self.assertRaises(KeyError, index_page.get_label_from_page, None) if __name__ == '__main__': -- To view, visit https://gerrit.wikimedia.org/r/243416 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8cc7383399f47710aec38a692cf0ea775205d12e Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Mpaa <mpaa.w...@gmail.com> Gerrit-Reviewer: John Vandenberg <jay...@gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: XZise <commodorefabia...@gmx.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ Pywikibot-commits mailing list Pywikibot-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits