jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/538423 )
Change subject: site_tests.py: add test for site.assert_valid_iter_params ......................................................................
site_tests.py: add test for site.assert_valid_iter_params
Change-Id: I73441b23d2dc16fe1b8c69d3b698950ad177d9bb --- M tests/site_tests.py 1 file changed, 20 insertions(+), 0 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py index fbc85d5..6bc862f 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -1065,6 +1065,26 @@ 'indexpageids': [True], 'continue': [True]}) self.assertLessEqual(len(tuple(upgen)), 3)
+ def test_assert_valid_iter_params(self): + """Test site.assert_valid_iter_params method.""" + func = self.site.assert_valid_iter_params + + # reverse=False, is_ts=False + self.assertIsNone(func('m', 1, 2, False, False)) + self.assertRaises(AssertionError, func, 'm', 2, 1, False, False) + + # reverse=False, is_ts=True + self.assertIsNone(func('m', 2, 1, False, True)) + self.assertRaises(AssertionError, func, 'm', 1, 2, False, True) + + # reverse=True, is_ts=False + self.assertIsNone(func('m', 2, 1, True, False)) + self.assertRaises(AssertionError, func, 'm', 1, 2, True, False) + + # reverse=True, is_ts=True + self.assertIsNone(func('m', 1, 2, True, True)) + self.assertRaises(AssertionError, func, 'm', 2, 1, True, True) +
class TestSiteGeneratorsUsers(DefaultSiteTestCase): """Test cases for Site methods with users."""
pywikibot-commits@lists.wikimedia.org