jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1227259?usp=email )

Change subject: tests: Fix ua format string result for in 
TestDrySite.test_user_agent
......................................................................

tests: Fix ua format string result for in TestDrySite.test_user_agent

user_agent_username() was changed to return a username set in
PYWIKIBOT_USERNAME or PWB_USERNAME environment variables

Bug: T414657
Change-Id: I6e244497844d0c6da00e13603e6a0e7c32e0ddc2
---
M tests/dry_site_tests.py
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/tests/dry_site_tests.py b/tests/dry_site_tests.py
index f9f0652..c8e492e 100755
--- a/tests/dry_site_tests.py
+++ b/tests/dry_site_tests.py
@@ -106,9 +106,9 @@
         ua_username = user_agent_username()
         self.assertEqual(f'Foo {ua_username}'.strip(),
                          user_agent(x, format_string='Foo {username}'))
-        self.assertEqual(f'Foo ({x})',
-                         user_agent(
-                             x, format_string='Foo ({script_comments})'))
+        res = f'Foo ({x}; User:{ua_username})' if ua_username else f'Foo ({x})'
+        self.assertEqual(
+            res, user_agent(x, format_string='Foo ({script_comments})'))


 if __name__ == '__main__':

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1227259?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: I6e244497844d0c6da00e13603e6a0e7c32e0ddc2
Gerrit-Change-Number: 1227259
Gerrit-PatchSet: 2
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]

Reply via email to