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):

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1040812?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I053c69438aedd5977fa438150f75e30c03f7e232
Gerrit-Change-Number: 1040812
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to