Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ruff: Fix ISC004 Unparenthesized implicit string concatenation in collection.

Anders Kaseorge211573b31f9
diff --git a/corporate/tests/test_remote_billing.py b/corporate/tests/test_remote_billing.py
index c5a62dda742..129f357c832 100644
--- a/corporate/tests/test_remote_billing.py
+++ b/corporate/tests/test_remote_billing.py
@@ -358,8 +358,10 @@ class RemoteBillingAuthenticationTest(RemoteRealmBillingTestCase):
self.assertEqual(
mock_log.output,
[
- f"WARNING:zilencer.auth:Remote server {self.server.hostname} {str(self.server.uuid)[:12]} exceeded "
- "rate limits on domain sends_email_by_remote_server"
+ (
+ f"WARNING:zilencer.auth:Remote server {self.server.hostname} {str(self.server.uuid)[:12]} exceeded "
+ "rate limits on domain sends_email_by_remote_server"
+ )
],
)
@@ -715,8 +717,10 @@ class RemoteBillingAuthenticationTest(RemoteRealmBillingTestCase):
self.assertEqual(
mock_logger.output,
[
- "INFO:corporate.stripe:Matching RemoteRealmBillingUser already exists for "
- f"PreregistrationRemoteRealmBillingUser {second_prereg_user.id}"
+ (
+ "INFO:corporate.stripe:Matching RemoteRealmBillingUser already exists for "
+ f"PreregistrationRemoteRealmBillingUser {second_prereg_user.id}"
+ )
],
)
@@ -899,8 +903,10 @@ class RemoteBillingAuthenticationTest(RemoteRealmBillingTestCase):
self.assertEqual(
mock_warn.output,
[
- f"WARNING:zilencer.views:Failed to migrate customer from server (id: {remote_realm.server.id}) to realm (id: {remote_realm.id}): "
- "RemoteRealm customer already exists and plans can't be migrated automatically."
+ (
+ f"WARNING:zilencer.views:Failed to migrate customer from server (id: {remote_realm.server.id}) to realm (id: {remote_realm.id}): "
+ "RemoteRealm customer already exists and plans can't be migrated automatically."
+ )
],
)
self.assert_json_error(
@@ -924,8 +930,10 @@ class RemoteBillingAuthenticationTest(RemoteRealmBillingTestCase):
self.assertEqual(
mock_warn.output,
[
- f"WARNING:zilencer.views:Failed to migrate customer from server (id: {remote_realm.server.id}) to realm (id: {remote_realm.id}): "
- "RemoteRealm customer already exists and plans can't be migrated automatically."
+ (
+ f"WARNING:zilencer.views:Failed to migrate customer from server (id: {remote_realm.server.id}) to realm (id: {remote_realm.id}): "
+ "RemoteRealm customer already exists and plans can't be migrated automatically."
+ )
],
)
self.assert_json_error(
@@ -949,8 +957,10 @@ class RemoteBillingAuthenticationTest(RemoteRealmBillingTestCase):
self.assertEqual(
mock_warn.output,
[
- f"WARNING:zilencer.views:Failed to migrate customer from server (id: {remote_realm.server.id}) to realm (id: {remote_realm.id}): "
- "RemoteRealm customer already exists and plans can't be migrated automatically."
+ (
+ f"WARNING:zilencer.views:Failed to migrate customer from server (id: {remote_realm.server.id}) to realm (id: {remote_realm.id}): "
+ "RemoteRealm customer already exists and plans can't be migrated automatically."
+ )
],
)
self.assert_json_error(
@@ -1369,8 +1379,10 @@ class LegacyServerLoginTest(RemoteServerTestCase):
self.assertEqual(
mock_log.output,
[
- f"WARNING:zilencer.auth:Remote server {self.server.hostname} {str(self.server.uuid)[:12]} exceeded "
- "rate limits on domain sends_email_by_remote_server"
+ (
+ f"WARNING:zilencer.auth:Remote server {self.server.hostname} {str(self.server.uuid)[:12]} exceeded "
+ "rate limits on domain sends_email_by_remote_server"
+ )
],
)
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py
index 483b26803ba..4cf6ad1968a 100644
--- a/corporate/tests/test_stripe.py
+++ b/corporate/tests/test_stripe.py
@@ -5192,8 +5192,10 @@ class BillingHelpersTest(ZulipTestCase):
self.assertEqual(
warning_log.output,
[
- "WARNING:corporate.stripe:Cannot deactivate remote server with ID "
- f"{remote_server.id}, server has already been deactivated."
+ (
+ "WARNING:corporate.stripe:Cannot deactivate remote server with ID "
+ f"{remote_server.id}, server has already been deactivated."
+ )
],
)
@@ -5211,8 +5213,10 @@ class BillingHelpersTest(ZulipTestCase):
self.assertEqual(
warning_log.output,
[
- "WARNING:corporate.stripe:Cannot reactivate remote server with ID "
- f"{remote_server.id}, server is already active."
+ (
+ "WARNING:corporate.stripe:Cannot reactivate remote server with ID "
+ f"{remote_server.id}, server is already active."
+ )
],
)
diff --git a/tools/tests/test_capitalization_checker.py b/tools/tests/test_capitalization_checker.py
index 9e593ed02c1..3ef9df4a885 100644
--- a/tools/tests/test_capitalization_checker.py
+++ b/tools/tests/test_capitalization_checker.py
@@ -130,12 +130,16 @@ class CheckCapitalizationTestCase(TestCase):
banned,
sorted(
[
- "realm found in 'Some text with realm in it'. "
- "The term realm should not appear in user-facing "
- "strings. Use organization instead.",
- "realm found in 'Realm in capital case'. "
- "The term realm should not appear in user-facing "
- "strings. Use organization instead.",
+ (
+ "realm found in 'Some text with realm in it'. "
+ "The term realm should not appear in user-facing "
+ "strings. Use organization instead."
+ ),
+ (
+ "realm found in 'Realm in capital case'. "
+ "The term realm should not appear in user-facing "
+ "strings. Use organization instead."
+ ),
]
),
)
diff --git a/zerver/tests/test_auth_backends.py b/zerver/tests/test_auth_backends.py
index aa4af80fa06..0eb518635da 100644
--- a/zerver/tests/test_auth_backends.py
+++ b/zerver/tests/test_auth_backends.py
@@ -1159,8 +1159,10 @@ class SocialAuthBase(DesktopFlowTestingLib, ZulipTestCase, ABC):
self.assertEqual(
m.output,
[
- f"INFO:{self.logger_string}:Authentication attempt from 127.0.0.1: "
- f"subdomain=zulip;username={self.email};outcome=failed;return_data={{}}"
+ (
+ f"INFO:{self.logger_string}:Authentication attempt from 127.0.0.1: "
+ f"subdomain=zulip;username={self.email};outcome=failed;return_data={{}}"
+ )
],
)
diff --git a/zerver/tests/test_bots.py b/zerver/tests/test_bots.py
index de5feb4f992..63769fa63f3 100644
--- a/zerver/tests/test_bots.py
+++ b/zerver/tests/test_bots.py
@@ -1975,8 +1975,10 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
self.assertEqual(
m.output,
[
- "WARNING:root:Overriding HTTP method via 'method' parameter: "
- f"original={result.request['REQUEST_METHOD']}, override={bot_info['method']}, client={request_notes.client_name}"
+ (
+ "WARNING:root:Overriding HTTP method via 'method' parameter: "
+ f"original={result.request['REQUEST_METHOD']}, override={bot_info['method']}, client={request_notes.client_name}"
+ )
],
)
diff --git a/zerver/tests/test_email_mirror.py b/zerver/tests/test_email_mirror.py
index 7ecc569f864..cd2555b46fd 100644
--- a/zerver/tests/test_email_mirror.py
+++ b/zerver/tests/test_email_mirror.py
@@ -497,8 +497,10 @@ class TestStreamEmailMessages(ZulipTestCase):
self.assertEqual(
m.output,
[
- f"INFO:{logger_name}:Failed to process email to {stream.name} ({stream.realm.string_id}): "
- f"Not authorized to send to channel '{stream.name}'",
+ (
+ f"INFO:{logger_name}:Failed to process email to {stream.name} ({stream.realm.string_id}): "
+ f"Not authorized to send to channel '{stream.name}'"
+ )
],
)
self.assertEqual(Message.objects.latest("id").id, last_message_id)
diff --git a/zerver/tests/test_handle_push_notification.py b/zerver/tests/test_handle_push_notification.py
index e854044b9e6..8307f827f44 100644
--- a/zerver/tests/test_handle_push_notification.py
+++ b/zerver/tests/test_handle_push_notification.py
@@ -113,9 +113,11 @@ class HandlePushNotificationTest(PushNotificationTestCase):
self.assertEqual(
views_logger.output,
[
- "INFO:zilencer.views:"
- f"Sending mobile push notifications for remote user 6cde5f7a-1f7e-4978-9716-49f69ebfc9fe:<id:{self.user_profile.id}><uuid:{self.user_profile.uuid}>: "
- f"{len(fcm_devices)} via FCM devices, {len(apns_devices)} via APNs devices",
+ (
+ "INFO:zilencer.views:"
+ f"Sending mobile push notifications for remote user 6cde5f7a-1f7e-4978-9716-49f69ebfc9fe:<id:{self.user_profile.id}><uuid:{self.user_profile.uuid}>: "
+ f"{len(fcm_devices)} via FCM devices, {len(apns_devices)} via APNs devices"
+ ),
],
)
for token in apns_devices:
@@ -303,9 +305,11 @@ class HandlePushNotificationTest(PushNotificationTestCase):
self.assertEqual(
views_logger.output,
[
- "INFO:zilencer.views:"
- f"Sending mobile push notifications for remote user 6cde5f7a-1f7e-4978-9716-49f69ebfc9fe:<id:{self.user_profile.id}><uuid:{self.user_profile.uuid}>: "
- f"{len(fcm_devices)} via FCM devices, {len(apns_devices)} via APNs devices",
+ (
+ "INFO:zilencer.views:"
+ f"Sending mobile push notifications for remote user 6cde5f7a-1f7e-4978-9716-49f69ebfc9fe:<id:{self.user_profile.id}><uuid:{self.user_profile.uuid}>: "
+ f"{len(fcm_devices)} via FCM devices, {len(apns_devices)} via APNs devices"
+ ),
],
)
for token in apns_devices:
diff --git a/zerver/tests/test_message_notification_emails.py b/zerver/tests/test_message_notification_emails.py
index 744ac45f719..f31db774ad2 100644
--- a/zerver/tests/test_message_notification_emails.py
+++ b/zerver/tests/test_message_notification_emails.py
@@ -1438,8 +1438,10 @@ class TestMessageNotificationEmails(ZulipTestCase):
self.assertEqual(
m.output,
[
- "WARNING:zerver.lib.email_notifications:Failed to convert time element "
- "'2025-09-30T16:30:00Z': Invalid datetime format",
+ (
+ "WARNING:zerver.lib.email_notifications:Failed to convert time element "
+ "'2025-09-30T16:30:00Z': Invalid datetime format"
+ ),
],
)
diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py
index 741d4d8fef5..268be51fadc 100644
--- a/zerver/tests/test_push_notifications.py
+++ b/zerver/tests/test_push_notifications.py
@@ -698,11 +698,15 @@ class PushBouncerNotificationTest(BouncerTestCase):
self.assertEqual(
logger.output,
[
- "INFO:zilencer.views:"
- f"Deduplicating push registrations for server id:{server.id} user id:{hamlet.id} uuid:{hamlet.uuid} and tokens:{sorted(t.token for t in android_tokens)}",
- "INFO:zilencer.views:"
- f"Sending mobile push notifications for remote user 6cde5f7a-1f7e-4978-9716-49f69ebfc9fe:<id:{hamlet.id}><uuid:{hamlet.uuid}>: "
- "2 via FCM devices, 1 via APNs devices",
+ (
+ "INFO:zilencer.views:"
+ f"Deduplicating push registrations for server id:{server.id} user id:{hamlet.id} uuid:{hamlet.uuid} and tokens:{sorted(t.token for t in android_tokens)}"
+ ),
+ (
+ "INFO:zilencer.views:"
+ f"Sending mobile push notifications for remote user 6cde5f7a-1f7e-4978-9716-49f69ebfc9fe:<id:{hamlet.id}><uuid:{hamlet.uuid}>: "
+ "2 via FCM devices, 1 via APNs devices"
+ ),
],
)
@@ -1075,8 +1079,10 @@ class PushBouncerNotificationTest(BouncerTestCase):
self.assertEqual(
warn_log.output,
[
- "WARNING:zilencer.views:/api/v1/remotes/push/register: "
- f"Realm {remote_realm.uuid!s} exists, but not registered to server {self.server.id}"
+ (
+ "WARNING:zilencer.views:/api/v1/remotes/push/register: "
+ f"Realm {remote_realm.uuid!s} exists, but not registered to server {self.server.id}"
+ )
],
)
diff --git a/zerver/tests/test_send_email.py b/zerver/tests/test_send_email.py
index 65267269017..6f1292d37b2 100644
--- a/zerver/tests/test_send_email.py
+++ b/zerver/tests/test_send_email.py
@@ -460,9 +460,11 @@ class TestSendEmail(ZulipTestCase):
self.assertEqual(
error_log.output,
[
- "ERROR:zulip.send_email:"
- "An SMTP username was set (EMAIL_HOST_USER), but password is unset (EMAIL_HOST_PASSWORD). "
- "To disable SMTP authentication, set EMAIL_HOST_USER to an empty string."
+ (
+ "ERROR:zulip.send_email:"
+ "An SMTP username was set (EMAIL_HOST_USER), but password is unset (EMAIL_HOST_PASSWORD). "
+ "To disable SMTP authentication, set EMAIL_HOST_USER to an empty string."
+ )
],
)
diff --git a/zerver/tests/test_slack_importer.py b/zerver/tests/test_slack_importer.py
index b8d9044495c..dfa2b81e0db 100644
--- a/zerver/tests/test_slack_importer.py
+++ b/zerver/tests/test_slack_importer.py
@@ -3329,8 +3329,10 @@ To Do
self.assertEqual(
logs.output,
[
- "INFO:zulip.registration:"
- "(test-realm) Slack import already completed; skipping redelivery"
+ (
+ "INFO:zulip.registration:"
+ "(test-realm) Slack import already completed; skipping redelivery"
+ )
],
)
diff --git a/zerver/tests/test_users.py b/zerver/tests/test_users.py
index 128aecbc448..f54a8e49504 100644
--- a/zerver/tests/test_users.py
+++ b/zerver/tests/test_users.py
@@ -2499,10 +2499,12 @@ class ActivateTest(ZulipTestCase):
self.assertEqual(
info_log.output,
[
- f"WARNING:zulip.send_email:ScheduledEmail {email_id} at {scheduled_at} "
- "had empty users and address attributes: "
- "{'template_prefix': 'zerver/emails/onboarding_zulip_topics', 'from_name': None, "
- "'from_address': None, 'language': None, 'context': {}}"
+ (
+ f"WARNING:zulip.send_email:ScheduledEmail {email_id} at {scheduled_at} "
+ "had empty users and address attributes: "
+ "{'template_prefix': 'zerver/emails/onboarding_zulip_topics', 'from_name': None, "
+ "'from_address': None, 'language': None, 'context': {}}"
+ )
],
)
diff --git a/zerver/tests/test_zilencer_analytics.py b/zerver/tests/test_zilencer_analytics.py
index 7fc3d7faa18..11ab8dcf03e 100644
--- a/zerver/tests/test_zilencer_analytics.py
+++ b/zerver/tests/test_zilencer_analytics.py
@@ -1393,8 +1393,10 @@ class AnalyticsBouncerTest(BouncerTestCase):
self.assertEqual(
analytics_logger.output,
[
- "WARNING:zulip.analytics:"
- f"Received unexpected realm UUID from bouncer {deleted_realm_uuid}"
+ (
+ "WARNING:zulip.analytics:"
+ f"Received unexpected realm UUID from bouncer {deleted_realm_uuid}"
+ )
],
)