jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1175206?usp=email )
Change subject: [tests] Make deletionbot dry-run test site-independent by using
actual mainpage
......................................................................
[tests] Make deletionbot dry-run test site-independent by using actual mainpage
Fixes a test failure on Wikidata where 'Main Page' does not exist by
dynamically retrieving the site's actual main page title via get_mainpage().
This ensures that the tested page exists on all sites and avoids false
negatives due to page.exists() returning False.
Also updates the assertion to reflect the dynamically determined page title.
Bug: T401039
Change-Id: Ia3b5c03ee29bfcd551f78764fe1f865a7e3bf92d
---
M tests/deletionbot_tests.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/deletionbot_tests.py b/tests/deletionbot_tests.py
index 22a521a..f7274f5 100755
--- a/tests/deletionbot_tests.py
+++ b/tests/deletionbot_tests.py
@@ -123,10 +123,11 @@
def test_dry(self) -> None:
"""Test dry run of bot."""
+ main = self.get_mainpage().title()
with empty_sites():
- delete.main('-page:Main Page', '-always', '-summary:foo')
+ delete.main(f'-page:{main}', '-always', '-summary:foo')
self.assertEqual(self.delete_args,
- ['[[Main Page]]', 'foo', False, True, True])
+ [f'[[{main}]]', 'foo', False, True, True])
with empty_sites():
delete.main(
'-page:FoooOoOooO', '-always', '-summary:foo', '-undelete')
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1175206?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia3b5c03ee29bfcd551f78764fe1f865a7e3bf92d
Gerrit-Change-Number: 1175206
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]