jenkins-bot has submitted this change and it was merged.
Change subject: Add sysop test for loadrevisions rollback=True ......................................................................
Add sysop test for loadrevisions rollback=True
Bug: 72763 Change-Id: I16a599ab9261cd3a41eebc242741431f76e49384 --- M tests/site_tests.py 1 file changed, 16 insertions(+), 0 deletions(-)
Approvals: XZise: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py index deb2d8c..0c13092 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -1439,6 +1439,22 @@ # TODO test other optional arguments
+class TestSiteLoadRevisionsSysop(DefaultSiteTestCase): + + """Test cases for Site.loadrevision() method.""" + + sysop = True + + def test_rollback(self): + """Test the site.loadrevisions() method with rollback.""" + mainpage = self.get_mainpage() + self.site.loadrevisions(mainpage, total=12, rollback=True, sysop=True) + self.assertGreater(len(mainpage._revisions), 0) + self.assertLessEqual(len(mainpage._revisions), 12) + self.assertTrue(all(rev.rollbacktoken is not None + for rev in mainpage._revisions.values())) + + class TestCommonsSite(TestCase):
"""Test cases for Site methods on Commons."""