python: Modernize legacy Python 2 syntax with pyupgrade.

Generated by `pyupgrade --py3-plus --keep-percent-format` on all our
Python code except `zthumbor` and `zulip-ec2-configure-interfaces`,
followed by manual indentation fixes.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-04-09 12:51:58 -07:00
committed by Tim Abbott
parent fff2d3958a
commit c734bbd95d
567 changed files with 1877 additions and 2564 deletions

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from django.test import TestCase
from zerver.lib.test_classes import WebhookTestCase
@@ -7,18 +6,18 @@ from zerver.webhooks.appfollow.view import convert_markdown
class AppFollowHookTests(WebhookTestCase):
STREAM_NAME = 'appfollow'
URL_TEMPLATE = u"/api/v1/external/appfollow?stream={stream}&api_key={api_key}"
URL_TEMPLATE = "/api/v1/external/appfollow?stream={stream}&api_key={api_key}"
def test_sample(self) -> None:
expected_topic = "Webhook integration was successful."
expected_message = u"""Webhook integration was successful.
expected_message = """Webhook integration was successful.
Test User / Acme (Google Play)"""
self.send_and_test_stream_message('sample', expected_topic, expected_message,
content_type="application/x-www-form-urlencoded")
def test_reviews(self) -> None:
expected_topic = "Acme - Group chat"
expected_message = u"""Acme - Group chat
expected_message = """Acme - Group chat
App Store, Acme Technologies, Inc.
★★★★★ United States
**Great for Information Management**
@@ -35,7 +34,7 @@ Acme enables me to manage the flow of information quite well. I only wish I coul
self.URL_TEMPLATE = original_url_template + "&topic=foo"
self.url = self.build_webhook_url()
expected_topic = "foo"
expected_message = u"""Acme - Group chat
expected_message = """Acme - Group chat
App Store, Acme Technologies, Inc.
★★★★★ United States
**Great for Information Management**