Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1177425?usp=email )

Change subject: tests: some more tests for titletranslate
......................................................................

tests: some more tests for titletranslate

Change-Id: I996ea55c0e0d96f3347947509f78caf36ca67fd0
---
M tests/titletranslate_tests.py
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Xqt: Verified; Looks good to me, approved




diff --git a/tests/titletranslate_tests.py b/tests/titletranslate_tests.py
index 1eb8be5..eefc989 100755
--- a/tests/titletranslate_tests.py
+++ b/tests/titletranslate_tests.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 """Tests for titletranslate module."""
 #
-# (C) Pywikibot team, 2022
+# (C) Pywikibot team, 2022-2025
 #
 # Distributed under the terms of the MIT license.
 #
@@ -38,6 +38,14 @@
         result = translate(page=self.get_mainpage(site), auto=False,
                            hints=['5:', 'nl,en,zh'], site=site)
         self.assertLength(result, 6)
+        result = translate(page=self.get_mainpage(site))
+        self.assertIsEmpty(result)
+        result = translate(page=self.get_mainpage(site), hints=['nl'])
+        self.assertLength(result, 1)
+        with self.assertRaisesRegex(RuntimeError,
+                                    'Either page or site parameter must be '
+                                    r'given with translate\(\)'):
+            translate()


 if __name__ == '__main__':

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

Reply via email to