jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1040812?usp=email )
Change subject: [tests] take into account that test page is modified in meantime ......................................................................
[tests] take into account that test page is modified in meantime
Bug: T367006 Change-Id: I053c69438aedd5977fa438150f75e30c03f7e232 --- M tests/oauth_tests.py 1 file changed, 6 insertions(+), 3 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/tests/oauth_tests.py b/tests/oauth_tests.py index 6a7cc5e..a39c528 100755 --- a/tests/oauth_tests.py +++ b/tests/oauth_tests.py @@ -79,14 +79,17 @@ ts = str(time.time()) p = pywikibot.Page(self.site, title) try: - p.site.editpage(p, appendtext=ts) + p.site.editpage(p, appendtext='\n' + ts) except EditConflictError as e: self.assertEqual(e.page, p) else: revision_id = p.latest_revision_id p = pywikibot.Page(self.site, title) - self.assertEqual(revision_id, p.latest_revision_id) - self.assertTrue(p.text.endswith(ts)) + t = p.text + if revision_id == p.latest_revision_id: + self.assertTrue(p.text.endswith(ts)) + else: + self.assertIn(ts, t)
class TestOauthLoginManger(DefaultSiteTestCase, OAuthSiteTestCase):