From dc31347ac4a30edc6a8f3b5b12a6b4f7fdbc49b9 Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Sat, 4 May 2024 22:02:50 +0200 Subject: [PATCH] webhooks: Rename STREAM_NAME to CHANNEL_NAME in tests. --- api_docs/incoming-webhooks-walkthrough.md | 16 ++++++++-------- zerver/lib/test_classes.py | 14 +++++++------- zerver/tests/test_webhooks_common.py | 14 +++++++------- zerver/webhooks/airbrake/tests.py | 2 +- zerver/webhooks/alertmanager/tests.py | 2 +- zerver/webhooks/ansibletower/tests.py | 2 +- zerver/webhooks/appfollow/tests.py | 2 +- zerver/webhooks/appveyor/tests.py | 2 +- zerver/webhooks/azuredevops/tests.py | 2 +- zerver/webhooks/basecamp/tests.py | 2 +- zerver/webhooks/beanstalk/tests.py | 2 +- zerver/webhooks/beeminder/tests.py | 2 +- zerver/webhooks/bitbucket/tests.py | 2 +- zerver/webhooks/bitbucket2/tests.py | 20 ++++++++++---------- zerver/webhooks/bitbucket3/tests.py | 8 ++++---- zerver/webhooks/buildbot/tests.py | 2 +- zerver/webhooks/canarytoken/tests.py | 2 +- zerver/webhooks/circleci/tests.py | 2 +- zerver/webhooks/clubhouse/tests.py | 2 +- zerver/webhooks/codeship/tests.py | 2 +- zerver/webhooks/crashlytics/tests.py | 2 +- zerver/webhooks/delighted/tests.py | 2 +- zerver/webhooks/deskdotcom/tests.py | 4 ++-- zerver/webhooks/dropbox/tests.py | 6 +++--- zerver/webhooks/errbit/tests.py | 2 +- zerver/webhooks/flock/tests.py | 2 +- zerver/webhooks/freshdesk/tests.py | 2 +- zerver/webhooks/freshping/tests.py | 2 +- zerver/webhooks/freshstatus/tests.py | 2 +- zerver/webhooks/front/tests.py | 2 +- zerver/webhooks/gci/tests.py | 2 +- zerver/webhooks/gitea/tests.py | 2 +- zerver/webhooks/github/tests.py | 8 ++++---- zerver/webhooks/gitlab/tests.py | 2 +- zerver/webhooks/gocd/tests.py | 2 +- zerver/webhooks/gogs/tests.py | 2 +- zerver/webhooks/gosquared/tests.py | 2 +- zerver/webhooks/grafana/tests.py | 2 +- zerver/webhooks/greenhouse/tests.py | 2 +- zerver/webhooks/groove/tests.py | 4 ++-- zerver/webhooks/harbor/tests.py | 2 +- zerver/webhooks/hellosign/tests.py | 2 +- zerver/webhooks/helloworld/tests.py | 4 ++-- zerver/webhooks/heroku/tests.py | 2 +- zerver/webhooks/homeassistant/tests.py | 2 +- zerver/webhooks/ifttt/tests.py | 2 +- zerver/webhooks/insping/tests.py | 2 +- zerver/webhooks/intercom/tests.py | 2 +- zerver/webhooks/jira/tests.py | 10 +++++----- zerver/webhooks/jotform/tests.py | 2 +- zerver/webhooks/json/tests.py | 2 +- zerver/webhooks/librato/tests.py | 2 +- zerver/webhooks/lidarr/tests.py | 2 +- zerver/webhooks/linear/tests.py | 2 +- zerver/webhooks/mention/tests.py | 2 +- zerver/webhooks/netlify/tests.py | 2 +- zerver/webhooks/newrelic/tests.py | 2 +- zerver/webhooks/opbeat/tests.py | 2 +- zerver/webhooks/opencollective/tests.py | 2 +- zerver/webhooks/opsgenie/tests.py | 2 +- zerver/webhooks/pagerduty/tests.py | 2 +- zerver/webhooks/papertrail/tests.py | 2 +- zerver/webhooks/patreon/tests.py | 2 +- zerver/webhooks/pingdom/tests.py | 2 +- zerver/webhooks/pivotal/tests.py | 4 ++-- zerver/webhooks/radarr/tests.py | 2 +- zerver/webhooks/raygun/tests.py | 2 +- zerver/webhooks/reviewboard/tests.py | 2 +- zerver/webhooks/rhodecode/tests.py | 2 +- zerver/webhooks/rundeck/tests.py | 2 +- zerver/webhooks/semaphore/tests.py | 2 +- zerver/webhooks/sentry/tests.py | 2 +- zerver/webhooks/slack/tests.py | 6 +++--- zerver/webhooks/slack_incoming/tests.py | 6 +++--- zerver/webhooks/solano/tests.py | 2 +- zerver/webhooks/sonarqube/tests.py | 2 +- zerver/webhooks/sonarr/tests.py | 2 +- zerver/webhooks/splunk/tests.py | 2 +- zerver/webhooks/statuspage/tests.py | 2 +- zerver/webhooks/stripe/tests.py | 2 +- zerver/webhooks/taiga/tests.py | 2 +- zerver/webhooks/teamcity/tests.py | 2 +- zerver/webhooks/thinkst/tests.py | 2 +- zerver/webhooks/transifex/tests.py | 2 +- zerver/webhooks/travis/tests.py | 2 +- zerver/webhooks/trello/tests.py | 2 +- zerver/webhooks/updown/tests.py | 8 ++++---- zerver/webhooks/uptimerobot/tests.py | 2 +- zerver/webhooks/wekan/tests.py | 2 +- zerver/webhooks/wordpress/tests.py | 6 +++--- zerver/webhooks/zabbix/tests.py | 2 +- zerver/webhooks/zapier/tests.py | 4 ++-- zerver/webhooks/zendesk/tests.py | 4 ++-- 93 files changed, 148 insertions(+), 148 deletions(-) diff --git a/api_docs/incoming-webhooks-walkthrough.md b/api_docs/incoming-webhooks-walkthrough.md index 64d11a1ce7..b2aafafb2f 100644 --- a/api_docs/incoming-webhooks-walkthrough.md +++ b/api_docs/incoming-webhooks-walkthrough.md @@ -328,7 +328,7 @@ class `HelloWorldHookTests`: ```python class HelloWorldHookTests(WebhookTestCase): - STREAM_NAME = "test" + CHANNEL_NAME = "test" URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}&stream={stream}" DIRECT_MESSAGE_URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}" WEBHOOK_DIR_NAME = "helloworld" @@ -347,14 +347,14 @@ class HelloWorldHookTests(WebhookTestCase): ) ``` -In the above example, `STREAM_NAME`, `URL_TEMPLATE`, and `WEBHOOK_DIR_NAME` refer +In the above example, `CHANNEL_NAME`, `URL_TEMPLATE`, and `WEBHOOK_DIR_NAME` refer to class attributes from the base class, `WebhookTestCase`. These are needed by the helper function `check_webhook` to determine how to execute -your test. `STREAM_NAME` should be set to your default stream. If it doesn't exist, +your test. `CHANNEL_NAME` should be set to your default stream. If it doesn't exist, `check_webhook` will create it while executing your test. If your test expects a stream name from a test fixture, the value in the fixture -and the value you set for `STREAM_NAME` must match. The test helpers use `STREAM_NAME` +and the value you set for `CHANNEL_NAME` must match. The test helpers use `CHANNEL_NAME` to create the destination stream, and then create the message to send using the value from the fixture. If these don't match, the test will fail. @@ -532,10 +532,10 @@ def test_unknown_action_no_data(self) -> None: # return if no params are sent. The fixture for this test is an empty file. # subscribe to the target stream - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) # post to the webhook url - post_params = {'stream_name': self.STREAM_NAME, + post_params = {'stream_name': self.CHANNEL_NAME, 'content_type': 'application/x-www-form-urlencoded'} result = self.client_post(self.url, 'unknown_action', **post_params) @@ -549,7 +549,7 @@ the webhook returns an error, the test fails. Instead, explicitly do the setup it would have done, and check the result yourself. Here, `subscribe_to_stream` is a test helper that uses `TEST_USER_EMAIL` and -`STREAM_NAME` (attributes from the base class) to register the user to receive +`CHANNEL_NAME` (attributes from the base class) to register the user to receive messages in the given stream. If the stream doesn't exist, it creates it. `client_post`, another helper, performs the HTTP POST that calls the incoming @@ -592,7 +592,7 @@ attribute `TOPIC` as a keyword argument to `build_webhook_url`, like so: ```python class QuerytestHookTests(WebhookTestCase): - STREAM_NAME = 'querytest' + CHANNEL_NAME = 'querytest' TOPIC = "Default topic" URL_TEMPLATE = "/api/v1/external/querytest?api_key={api_key}&stream={stream}" FIXTURE_DIR_NAME = 'querytest' diff --git a/zerver/lib/test_classes.py b/zerver/lib/test_classes.py index fcba2af464..5ef8fb6791 100644 --- a/zerver/lib/test_classes.py +++ b/zerver/lib/test_classes.py @@ -2080,7 +2080,7 @@ class WebhookTestCase(ZulipTestCase): important for ensuring we document all fully supported event types. """ - STREAM_NAME: Optional[str] = None + CHANNEL_NAME: Optional[str] = None TEST_USER_EMAIL = "webhook-bot@zulip.com" URL_TEMPLATE: str WEBHOOK_DIR_NAME: Optional[str] = None @@ -2185,7 +2185,7 @@ You can fix this by adding "{complete_event_type}" to ALL_EVENT_TYPES for this w We use `fixture_name` to find the payload data in of our test fixtures. Then we verify that a message gets sent to a stream: - self.STREAM_NAME: stream name + self.CHANNEL_NAME: stream name expected_topic_name: topic name expected_message: content @@ -2197,8 +2197,8 @@ You can fix this by adding "{complete_event_type}" to ALL_EVENT_TYPES for this w When no message is expected to be sent, set `expect_noop` to True. """ - assert self.STREAM_NAME is not None - self.subscribe(self.test_user, self.STREAM_NAME) + assert self.CHANNEL_NAME is not None + self.subscribe(self.test_user, self.CHANNEL_NAME) payload = self.get_payload(fixture_name) if content_type is not None: @@ -2234,7 +2234,7 @@ one or more new messages. self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=expected_topic_name, content=expected_message, ) @@ -2291,9 +2291,9 @@ one or more new messages. url = self.URL_TEMPLATE if url.find("api_key") >= 0: api_key = get_api_key(self.test_user) - url = self.URL_TEMPLATE.format(api_key=api_key, stream=self.STREAM_NAME) + url = self.URL_TEMPLATE.format(api_key=api_key, stream=self.CHANNEL_NAME) else: - url = self.URL_TEMPLATE.format(stream=self.STREAM_NAME) + url = self.URL_TEMPLATE.format(stream=self.CHANNEL_NAME) has_arguments = kwargs or args if has_arguments and url.find("?") == -1: diff --git a/zerver/tests/test_webhooks_common.py b/zerver/tests/test_webhooks_common.py index 675e7882a7..a636f3bac1 100644 --- a/zerver/tests/test_webhooks_common.py +++ b/zerver/tests/test_webhooks_common.py @@ -144,25 +144,25 @@ class WebhooksCommonTestCase(ZulipTestCase): class WebhookURLConfigurationTestCase(WebhookTestCase): - STREAM_NAME = "helloworld" + CHANNEL_NAME = "helloworld" WEBHOOK_DIR_NAME = "helloworld" URL_TEMPLATE = "/api/v1/external/helloworld?stream={stream}&api_key={api_key}" @override def setUp(self) -> None: super().setUp() - stream = self.subscribe(self.test_user, self.STREAM_NAME) + stream = self.subscribe(self.test_user, self.CHANNEL_NAME) # In actual webhook tests, we will not need to use stream id. - # We assign stream id to STREAM_NAME for testing URL configuration only. - self.STREAM_NAME = str(stream.id) + # We assign stream id to CHANNEL_NAME for testing URL configuration only. + self.CHANNEL_NAME = str(stream.id) do_rename_stream(stream, "helloworld_renamed", self.test_user) self.url = self.build_webhook_url() def test_trigger_stream_message_by_id(self) -> None: # check_webhook cannot be used here as it - # subscribes the test user to self.STREAM_NAME + # subscribes the test user to self.CHANNEL_NAME payload = self.get_body("hello") self.send_webhook_payload( @@ -182,13 +182,13 @@ class WebhookURLConfigurationTestCase(WebhookTestCase): class MissingEventHeaderTestCase(WebhookTestCase): - STREAM_NAME = "groove" + CHANNEL_NAME = "groove" URL_TEMPLATE = "/api/v1/external/groove?stream={stream}&api_key={api_key}" # This tests the validate_extract_webhook_http_header function with # an actual webhook, instead of just making a mock def test_missing_event_header(self) -> None: - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) with self.assertLogs("zulip.zerver.webhooks.anomalous", level="INFO") as webhook_logs: result = self.client_post( self.url, diff --git a/zerver/webhooks/airbrake/tests.py b/zerver/webhooks/airbrake/tests.py index bb98c567e6..24b7c659da 100644 --- a/zerver/webhooks/airbrake/tests.py +++ b/zerver/webhooks/airbrake/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class AirbrakeHookTests(WebhookTestCase): - STREAM_NAME = "airbrake" + CHANNEL_NAME = "airbrake" URL_TEMPLATE = "/api/v1/external/airbrake?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "airbrake" diff --git a/zerver/webhooks/alertmanager/tests.py b/zerver/webhooks/alertmanager/tests.py index 2d7453f75c..e395c631a9 100644 --- a/zerver/webhooks/alertmanager/tests.py +++ b/zerver/webhooks/alertmanager/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class AlertmanagerHookTests(WebhookTestCase): - STREAM_NAME = "alertmanager" + CHANNEL_NAME = "alertmanager" URL_TEMPLATE = "/api/v1/external/alertmanager?&api_key={api_key}&stream={stream}&name=topic&desc=description" WEBHOOK_DIR_NAME = "alertmanager" diff --git a/zerver/webhooks/ansibletower/tests.py b/zerver/webhooks/ansibletower/tests.py index 5a8abcac5f..a5ab2dd6d4 100644 --- a/zerver/webhooks/ansibletower/tests.py +++ b/zerver/webhooks/ansibletower/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class AnsibletowerHookTests(WebhookTestCase): - STREAM_NAME = "ansibletower" + CHANNEL_NAME = "ansibletower" URL_TEMPLATE = "/api/v1/external/ansibletower?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "ansibletower" diff --git a/zerver/webhooks/appfollow/tests.py b/zerver/webhooks/appfollow/tests.py index b5fa98a307..76146d912a 100644 --- a/zerver/webhooks/appfollow/tests.py +++ b/zerver/webhooks/appfollow/tests.py @@ -3,7 +3,7 @@ from zerver.webhooks.appfollow.view import convert_markdown class AppFollowHookTests(WebhookTestCase): - STREAM_NAME = "appfollow" + CHANNEL_NAME = "appfollow" URL_TEMPLATE = "/api/v1/external/appfollow?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "appfollow" diff --git a/zerver/webhooks/appveyor/tests.py b/zerver/webhooks/appveyor/tests.py index 481e2e634c..78c6d8c28f 100644 --- a/zerver/webhooks/appveyor/tests.py +++ b/zerver/webhooks/appveyor/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class AppveyorHookTests(WebhookTestCase): - STREAM_NAME = "appveyor" + CHANNEL_NAME = "appveyor" URL_TEMPLATE = "/api/v1/external/appveyor?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "appveyor" diff --git a/zerver/webhooks/azuredevops/tests.py b/zerver/webhooks/azuredevops/tests.py index 174a994f42..7dfc62fa67 100644 --- a/zerver/webhooks/azuredevops/tests.py +++ b/zerver/webhooks/azuredevops/tests.py @@ -5,7 +5,7 @@ from zerver.lib.webhooks.git import COMMITS_LIMIT class AzuredevopsHookTests(WebhookTestCase): - STREAM_NAME = "azure-devops" + CHANNEL_NAME = "azure-devops" URL_TEMPLATE = "/api/v1/external/azuredevops?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "azuredevops" diff --git a/zerver/webhooks/basecamp/tests.py b/zerver/webhooks/basecamp/tests.py index b537210e51..9455b5bbc8 100644 --- a/zerver/webhooks/basecamp/tests.py +++ b/zerver/webhooks/basecamp/tests.py @@ -4,7 +4,7 @@ TOPIC_NAME = "Zulip HQ" class BasecampHookTests(WebhookTestCase): - STREAM_NAME = "basecamp" + CHANNEL_NAME = "basecamp" URL_TEMPLATE = "/api/v1/external/basecamp?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "basecamp" diff --git a/zerver/webhooks/beanstalk/tests.py b/zerver/webhooks/beanstalk/tests.py index 638844180b..c6a5e8bdf6 100644 --- a/zerver/webhooks/beanstalk/tests.py +++ b/zerver/webhooks/beanstalk/tests.py @@ -8,7 +8,7 @@ from zerver.lib.webhooks.git import COMMITS_LIMIT class BeanstalkHookTests(WebhookTestCase): - STREAM_NAME = "commits" + CHANNEL_NAME = "commits" URL_TEMPLATE = "/api/v1/external/beanstalk?stream={stream}" def test_git_single(self) -> None: diff --git a/zerver/webhooks/beeminder/tests.py b/zerver/webhooks/beeminder/tests.py index 4d6e452724..23a1378eaa 100644 --- a/zerver/webhooks/beeminder/tests.py +++ b/zerver/webhooks/beeminder/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class BeeminderHookTests(WebhookTestCase): - STREAM_NAME = "beeminder" + CHANNEL_NAME = "beeminder" URL_TEMPLATE = "/api/v1/external/beeminder?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "beeminder" diff --git a/zerver/webhooks/bitbucket/tests.py b/zerver/webhooks/bitbucket/tests.py index e73da00c9c..d43130abe1 100644 --- a/zerver/webhooks/bitbucket/tests.py +++ b/zerver/webhooks/bitbucket/tests.py @@ -7,7 +7,7 @@ TOPIC_BRANCH_EVENTS = "Repository name / master" class BitbucketHookTests(WebhookTestCase): - STREAM_NAME = "bitbucket" + CHANNEL_NAME = "bitbucket" URL_TEMPLATE = "/api/v1/external/bitbucket?stream={stream}" WEBHOOK_DIR_NAME = "bitbucket" diff --git a/zerver/webhooks/bitbucket2/tests.py b/zerver/webhooks/bitbucket2/tests.py index b7c7056790..4684e1118c 100644 --- a/zerver/webhooks/bitbucket2/tests.py +++ b/zerver/webhooks/bitbucket2/tests.py @@ -14,7 +14,7 @@ TOPIC_BRANCH_EVENTS = "Repository name / master" class Bitbucket2HookTests(WebhookTestCase): - STREAM_NAME = "bitbucket2" + CHANNEL_NAME = "bitbucket2" URL_TEMPLATE = "/api/v1/external/bitbucket2?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "bitbucket2" @@ -278,7 +278,7 @@ class Bitbucket2HookTests(WebhookTestCase): def test_bitbucket2_on_push_more_than_one_tag_event(self) -> None: expected_message = "Tomasz pushed tag [{name}](https://bitbucket.org/kolaszek/repository-name/commits/tag/{name})." - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) payload = self.get_body("push_more_than_one_tag") msg = self.send_webhook_payload( @@ -292,7 +292,7 @@ class Bitbucket2HookTests(WebhookTestCase): msg = self.get_second_to_last_message() self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=TOPIC, content=expected_message.format(name="a"), ) @@ -300,13 +300,13 @@ class Bitbucket2HookTests(WebhookTestCase): msg = self.get_last_message() self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=TOPIC, content=expected_message.format(name="b"), ) def test_bitbucket2_on_more_than_one_push_event(self) -> None: - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) payload = self.get_body("more_than_one_push_event") msg = self.send_webhook_payload( @@ -320,7 +320,7 @@ class Bitbucket2HookTests(WebhookTestCase): msg = self.get_second_to_last_message() self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=TOPIC_BRANCH_EVENTS, content="Tomasz [pushed](https://bitbucket.org/kolaszek/repository-name/branch/master) 1 commit to branch master.\n\n* first commit ([84b96adc644](https://bitbucket.org/kolaszek/repository-name/commits/84b96adc644a30fd6465b3d196369d880762afed))", ) @@ -328,7 +328,7 @@ class Bitbucket2HookTests(WebhookTestCase): msg = self.get_last_message() self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=TOPIC, content="Tomasz pushed tag [a](https://bitbucket.org/kolaszek/repository-name/commits/tag/a).", ) @@ -336,7 +336,7 @@ class Bitbucket2HookTests(WebhookTestCase): def test_bitbucket2_on_more_than_one_push_event_filtered_by_branches(self) -> None: self.url = self.build_webhook_url(branches="master,development") - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) payload = self.get_body("more_than_one_push_event") msg = self.send_webhook_payload( @@ -350,7 +350,7 @@ class Bitbucket2HookTests(WebhookTestCase): msg = self.get_second_to_last_message() self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=TOPIC_BRANCH_EVENTS, content="Tomasz [pushed](https://bitbucket.org/kolaszek/repository-name/branch/master) 1 commit to branch master.\n\n* first commit ([84b96adc644](https://bitbucket.org/kolaszek/repository-name/commits/84b96adc644a30fd6465b3d196369d880762afed))", ) @@ -358,7 +358,7 @@ class Bitbucket2HookTests(WebhookTestCase): msg = self.get_last_message() self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=TOPIC, content="Tomasz pushed tag [a](https://bitbucket.org/kolaszek/repository-name/commits/tag/a).", ) diff --git a/zerver/webhooks/bitbucket3/tests.py b/zerver/webhooks/bitbucket3/tests.py index 7449dad757..b25bab5ec6 100644 --- a/zerver/webhooks/bitbucket3/tests.py +++ b/zerver/webhooks/bitbucket3/tests.py @@ -5,7 +5,7 @@ TOPIC_BRANCH_EVENTS = "sandbox / {branch}" class Bitbucket3HookTests(WebhookTestCase): - STREAM_NAME = "bitbucket3" + CHANNEL_NAME = "bitbucket3" URL_TEMPLATE = "/api/v1/external/bitbucket3?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "bitbucket3" @@ -81,7 +81,7 @@ class Bitbucket3HookTests(WebhookTestCase): branch1_content = """[hypro999](http://139.59.64.214:7990/users/hypro999) pushed to branch branch1. Head is now 3980c2be32a7e23c795741d5dc1a2eecb9b85d6d.""" master_content = """[hypro999](http://139.59.64.214:7990/users/hypro999) pushed to branch master. Head is now fc43d13cff1abb28631196944ba4fc4ad06a2cf2.""" - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) payload = self.get_body("repo_push_update_multiple_branches") msg = self.send_webhook_payload( @@ -94,7 +94,7 @@ class Bitbucket3HookTests(WebhookTestCase): msg = self.get_second_to_last_message() self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=TOPIC_BRANCH_EVENTS.format(branch="branch1"), content=branch1_content, ) @@ -102,7 +102,7 @@ class Bitbucket3HookTests(WebhookTestCase): msg = self.get_last_message() self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=TOPIC_BRANCH_EVENTS.format(branch="master"), content=master_content, ) diff --git a/zerver/webhooks/buildbot/tests.py b/zerver/webhooks/buildbot/tests.py index 8d96b5b078..0628c12c80 100644 --- a/zerver/webhooks/buildbot/tests.py +++ b/zerver/webhooks/buildbot/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class BuildbotHookTests(WebhookTestCase): - STREAM_NAME = "buildbot" + CHANNEL_NAME = "buildbot" URL_TEMPLATE = "/api/v1/external/buildbot?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "buildbot" diff --git a/zerver/webhooks/canarytoken/tests.py b/zerver/webhooks/canarytoken/tests.py index 23c7d94733..0d428bdd9c 100644 --- a/zerver/webhooks/canarytoken/tests.py +++ b/zerver/webhooks/canarytoken/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class CanarytokensHookTests(WebhookTestCase): - STREAM_NAME = "canarytoken" + CHANNEL_NAME = "canarytoken" URL_TEMPLATE = "/api/v1/external/canarytoken?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "canarytoken" diff --git a/zerver/webhooks/circleci/tests.py b/zerver/webhooks/circleci/tests.py index b5b5cac00c..7a09795bd1 100644 --- a/zerver/webhooks/circleci/tests.py +++ b/zerver/webhooks/circleci/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class CircleCiHookTests(WebhookTestCase): - STREAM_NAME = "circleci" + CHANNEL_NAME = "circleci" URL_TEMPLATE = "/api/v1/external/circleci?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "circleci" diff --git a/zerver/webhooks/clubhouse/tests.py b/zerver/webhooks/clubhouse/tests.py index 046a15b815..a4fcae2563 100644 --- a/zerver/webhooks/clubhouse/tests.py +++ b/zerver/webhooks/clubhouse/tests.py @@ -5,7 +5,7 @@ from zerver.lib.test_classes import WebhookTestCase class ClubhouseWebhookTest(WebhookTestCase): - STREAM_NAME = "clubhouse" + CHANNEL_NAME = "clubhouse" URL_TEMPLATE = "/api/v1/external/clubhouse?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "clubhouse" diff --git a/zerver/webhooks/codeship/tests.py b/zerver/webhooks/codeship/tests.py index 605cff4836..c3c2206117 100644 --- a/zerver/webhooks/codeship/tests.py +++ b/zerver/webhooks/codeship/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class CodeshipHookTests(WebhookTestCase): - STREAM_NAME = "codeship" + CHANNEL_NAME = "codeship" URL_TEMPLATE = "/api/v1/external/codeship?stream={stream}&api_key={api_key}" TOPIC_NAME = "codeship/docs" WEBHOOK_DIR_NAME = "codeship" diff --git a/zerver/webhooks/crashlytics/tests.py b/zerver/webhooks/crashlytics/tests.py index 58249a5b64..44f532e32b 100644 --- a/zerver/webhooks/crashlytics/tests.py +++ b/zerver/webhooks/crashlytics/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class CrashlyticsHookTests(WebhookTestCase): - STREAM_NAME = "crashlytics" + CHANNEL_NAME = "crashlytics" URL_TEMPLATE = "/api/v1/external/crashlytics?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "crashlytics" diff --git a/zerver/webhooks/delighted/tests.py b/zerver/webhooks/delighted/tests.py index 212be2bcdc..69bc770c64 100644 --- a/zerver/webhooks/delighted/tests.py +++ b/zerver/webhooks/delighted/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class DelightedHookTests(WebhookTestCase): - STREAM_NAME = "delighted" + CHANNEL_NAME = "delighted" URL_TEMPLATE = "/api/v1/external/delighted?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "delighted" diff --git a/zerver/webhooks/deskdotcom/tests.py b/zerver/webhooks/deskdotcom/tests.py index 0140230f77..964126d4bc 100644 --- a/zerver/webhooks/deskdotcom/tests.py +++ b/zerver/webhooks/deskdotcom/tests.py @@ -5,7 +5,7 @@ from zerver.lib.test_classes import WebhookTestCase # Tests for the Desk.com webhook integration. # # The stream name must be provided in the URL-encoded test fixture data, -# and must match STREAM_NAME set here. +# and must match CHANNEL_NAME set here. # # Example: # @@ -14,7 +14,7 @@ from zerver.lib.test_classes import WebhookTestCase class DeskDotComHookTests(WebhookTestCase): - STREAM_NAME = "deskdotcom" + CHANNEL_NAME = "deskdotcom" URL_TEMPLATE = "/api/v1/external/deskdotcom?stream={stream}" WEBHOOK_DIR_NAME = "deskdotcom" diff --git a/zerver/webhooks/dropbox/tests.py b/zerver/webhooks/dropbox/tests.py index 6001f6e980..b9a11aa882 100644 --- a/zerver/webhooks/dropbox/tests.py +++ b/zerver/webhooks/dropbox/tests.py @@ -3,7 +3,7 @@ from zerver.lib.users import get_api_key class DropboxHookTests(WebhookTestCase): - STREAM_NAME = "test" + CHANNEL_NAME = "test" URL_TEMPLATE = "/api/v1/external/dropbox?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "dropbox" @@ -19,8 +19,8 @@ class DropboxHookTests(WebhookTestCase): ) def test_verification_request(self) -> None: - self.subscribe(self.test_user, self.STREAM_NAME) - get_params = {"stream_name": self.STREAM_NAME, "api_key": get_api_key(self.test_user)} + self.subscribe(self.test_user, self.CHANNEL_NAME) + get_params = {"stream_name": self.CHANNEL_NAME, "api_key": get_api_key(self.test_user)} result = self.client_get(self.url, get_params) self.assert_json_error(result, "Missing 'challenge' argument", 400) diff --git a/zerver/webhooks/errbit/tests.py b/zerver/webhooks/errbit/tests.py index 633c52d439..b9ed308861 100644 --- a/zerver/webhooks/errbit/tests.py +++ b/zerver/webhooks/errbit/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class ErrBitHookTests(WebhookTestCase): - STREAM_NAME = "errbit" + CHANNEL_NAME = "errbit" URL_TEMPLATE = "/api/v1/external/errbit?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "errbit" diff --git a/zerver/webhooks/flock/tests.py b/zerver/webhooks/flock/tests.py index 7a8f4be7a9..973d098a8a 100644 --- a/zerver/webhooks/flock/tests.py +++ b/zerver/webhooks/flock/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class FlockHookTests(WebhookTestCase): - STREAM_NAME = "test" + CHANNEL_NAME = "test" URL_TEMPLATE = "/api/v1/external/flock?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "flock" diff --git a/zerver/webhooks/freshdesk/tests.py b/zerver/webhooks/freshdesk/tests.py index 1189bd33f8..7ec64552a8 100644 --- a/zerver/webhooks/freshdesk/tests.py +++ b/zerver/webhooks/freshdesk/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class FreshdeskHookTests(WebhookTestCase): - STREAM_NAME = "freshdesk" + CHANNEL_NAME = "freshdesk" URL_TEMPLATE = "/api/v1/external/freshdesk?stream={stream}" WEBHOOK_DIR_NAME = "freshdesk" diff --git a/zerver/webhooks/freshping/tests.py b/zerver/webhooks/freshping/tests.py index 134fa1248a..be22b84848 100644 --- a/zerver/webhooks/freshping/tests.py +++ b/zerver/webhooks/freshping/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class FreshpingHookTests(WebhookTestCase): - STREAM_NAME = "freshping" + CHANNEL_NAME = "freshping" URL_TEMPLATE = "/api/v1/external/freshping?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "freshping" diff --git a/zerver/webhooks/freshstatus/tests.py b/zerver/webhooks/freshstatus/tests.py index 2ac1c623a1..c8edf023c0 100644 --- a/zerver/webhooks/freshstatus/tests.py +++ b/zerver/webhooks/freshstatus/tests.py @@ -5,7 +5,7 @@ from zerver.webhooks.freshstatus.view import MISCONFIGURED_PAYLOAD_ERROR_MESSAGE class FreshstatusHookTests(WebhookTestCase): - STREAM_NAME = "freshstatus" + CHANNEL_NAME = "freshstatus" URL_TEMPLATE = "/api/v1/external/freshstatus?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "freshstatus" diff --git a/zerver/webhooks/front/tests.py b/zerver/webhooks/front/tests.py index a4c4983d09..250ba13a3b 100644 --- a/zerver/webhooks/front/tests.py +++ b/zerver/webhooks/front/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class FrontHookTests(WebhookTestCase): - STREAM_NAME = "front" + CHANNEL_NAME = "front" URL_TEMPLATE = "/api/v1/external/front?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "front" diff --git a/zerver/webhooks/gci/tests.py b/zerver/webhooks/gci/tests.py index 154f741e8d..e7202ac9ca 100644 --- a/zerver/webhooks/gci/tests.py +++ b/zerver/webhooks/gci/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class GoogleCodeInTests(WebhookTestCase): - STREAM_NAME = "gci" + CHANNEL_NAME = "gci" URL_TEMPLATE = "/api/v1/external/gci?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "gci" diff --git a/zerver/webhooks/gitea/tests.py b/zerver/webhooks/gitea/tests.py index 5c7167b706..c6825f7124 100644 --- a/zerver/webhooks/gitea/tests.py +++ b/zerver/webhooks/gitea/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class GiteaHookTests(WebhookTestCase): - STREAM_NAME = "commits" + CHANNEL_NAME = "commits" URL_TEMPLATE = "/api/v1/external/gitea?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "gitea" diff --git a/zerver/webhooks/github/tests.py b/zerver/webhooks/github/tests.py index 7326fd59a3..9bb0c06f76 100644 --- a/zerver/webhooks/github/tests.py +++ b/zerver/webhooks/github/tests.py @@ -17,7 +17,7 @@ TOPIC_SPONSORS = "sponsors" class GitHubWebhookTest(WebhookTestCase): - STREAM_NAME = "github" + CHANNEL_NAME = "github" URL_TEMPLATE = "/api/v1/external/github?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "github" @@ -535,7 +535,7 @@ A temporary team so that I can get some webhook fixtures! self.verify_post_is_ignored(payload, event) def test_team_edited_with_unsupported_keys(self) -> None: - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) event = "team" payload = dict( @@ -560,7 +560,7 @@ A temporary team so that I can get some webhook fixtures! self.assert_stream_message( message=stream_message, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name="team My Team", content="Team has changes to `bogus_key1/bogus_key2` data.", ) @@ -595,7 +595,7 @@ A temporary team so that I can get some webhook fixtures! class GitHubSponsorsHookTests(WebhookTestCase): - STREAM_NAME = "github" + CHANNEL_NAME = "github" URL_TEMPLATE = "/api/v1/external/githubsponsors?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "github" diff --git a/zerver/webhooks/gitlab/tests.py b/zerver/webhooks/gitlab/tests.py index 6d83eb1922..01690e0947 100644 --- a/zerver/webhooks/gitlab/tests.py +++ b/zerver/webhooks/gitlab/tests.py @@ -5,7 +5,7 @@ from zerver.lib.webhooks.git import COMMITS_LIMIT class GitlabHookTests(WebhookTestCase): - STREAM_NAME = "gitlab" + CHANNEL_NAME = "gitlab" URL_TEMPLATE = "/api/v1/external/gitlab?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "gitlab" diff --git a/zerver/webhooks/gocd/tests.py b/zerver/webhooks/gocd/tests.py index f2f2f1333f..739be052dd 100644 --- a/zerver/webhooks/gocd/tests.py +++ b/zerver/webhooks/gocd/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class GocdHookTests(WebhookTestCase): - STREAM_NAME = "gocd" + CHANNEL_NAME = "gocd" URL_TEMPLATE = "/api/v1/external/gocd?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "gocd" TOPIC_NAME = "https://github.com/gocd/gocd" diff --git a/zerver/webhooks/gogs/tests.py b/zerver/webhooks/gogs/tests.py index 86bef4b406..3c98140e22 100644 --- a/zerver/webhooks/gogs/tests.py +++ b/zerver/webhooks/gogs/tests.py @@ -5,7 +5,7 @@ from zerver.lib.webhooks.git import COMMITS_LIMIT class GogsHookTests(WebhookTestCase): - STREAM_NAME = "commits" + CHANNEL_NAME = "commits" URL_TEMPLATE = "/api/v1/external/gogs?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "gogs" diff --git a/zerver/webhooks/gosquared/tests.py b/zerver/webhooks/gosquared/tests.py index 1a6a4373c3..0e822768a9 100644 --- a/zerver/webhooks/gosquared/tests.py +++ b/zerver/webhooks/gosquared/tests.py @@ -3,7 +3,7 @@ from zerver.webhooks.gosquared.view import CHAT_MESSAGE_TEMPLATE class GoSquaredHookTests(WebhookTestCase): - STREAM_NAME = "gosquared" + CHANNEL_NAME = "gosquared" URL_TEMPLATE = "/api/v1/external/gosquared?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "gosquared" diff --git a/zerver/webhooks/grafana/tests.py b/zerver/webhooks/grafana/tests.py index e071637b61..803441521c 100644 --- a/zerver/webhooks/grafana/tests.py +++ b/zerver/webhooks/grafana/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class GrafanaHookTests(WebhookTestCase): - STREAM_NAME = "grafana" + CHANNEL_NAME = "grafana" URL_TEMPLATE = "/api/v1/external/grafana?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "grafana" diff --git a/zerver/webhooks/greenhouse/tests.py b/zerver/webhooks/greenhouse/tests.py index 71945fd781..73fd990477 100644 --- a/zerver/webhooks/greenhouse/tests.py +++ b/zerver/webhooks/greenhouse/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class GreenhouseHookTests(WebhookTestCase): - STREAM_NAME = "greenhouse" + CHANNEL_NAME = "greenhouse" URL_TEMPLATE = "/api/v1/external/greenhouse?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "greenhouse" CONTENT_TYPE = "application/x-www-form-urlencoded" diff --git a/zerver/webhooks/groove/tests.py b/zerver/webhooks/groove/tests.py index ffb7068fa2..3c7ef99fc2 100644 --- a/zerver/webhooks/groove/tests.py +++ b/zerver/webhooks/groove/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class GrooveHookTests(WebhookTestCase): - STREAM_NAME = "groove" + CHANNEL_NAME = "groove" URL_TEMPLATE = "/api/v1/external/groove?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "groove" @@ -64,7 +64,7 @@ The content of the body goes here. # This simulates the condition when a ticket # is assigned to no one. def test_groove_ticket_assigned_no_one(self) -> None: - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) result = self.client_post( self.url, self.get_body("ticket_assigned__no_one"), diff --git a/zerver/webhooks/harbor/tests.py b/zerver/webhooks/harbor/tests.py index 7774bbc44b..83c0466d30 100644 --- a/zerver/webhooks/harbor/tests.py +++ b/zerver/webhooks/harbor/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class HarborHookTests(WebhookTestCase): - STREAM_NAME = "harbor" + CHANNEL_NAME = "harbor" URL_TEMPLATE = "/api/v1/external/harbor?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "harbor" diff --git a/zerver/webhooks/hellosign/tests.py b/zerver/webhooks/hellosign/tests.py index 0a22b0fdaa..891bcd14e7 100644 --- a/zerver/webhooks/hellosign/tests.py +++ b/zerver/webhooks/hellosign/tests.py @@ -6,7 +6,7 @@ from zerver.lib.test_classes import WebhookTestCase class HelloSignHookTests(WebhookTestCase): - STREAM_NAME = "hellosign" + CHANNEL_NAME = "hellosign" URL_TEMPLATE = "/api/v1/external/hellosign?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "hellosign" diff --git a/zerver/webhooks/helloworld/tests.py b/zerver/webhooks/helloworld/tests.py index c58f52415f..a3c7d0f09c 100644 --- a/zerver/webhooks/helloworld/tests.py +++ b/zerver/webhooks/helloworld/tests.py @@ -6,7 +6,7 @@ from zerver.models.users import get_system_bot class HelloWorldHookTests(WebhookTestCase): - STREAM_NAME = "test" + CHANNEL_NAME = "test" URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}&stream={stream}" DIRECT_MESSAGE_URL_TEMPLATE = "/api/v1/external/helloworld?&api_key={api_key}" WEBHOOK_DIR_NAME = "helloworld" @@ -50,7 +50,7 @@ class HelloWorldHookTests(WebhookTestCase): def test_stream_error_pm_to_bot_owner(self) -> None: # Note that this is really just a test for check_send_webhook_message - self.STREAM_NAME = "nonexistent" + self.CHANNEL_NAME = "nonexistent" self.url = self.build_webhook_url() realm = get_realm("zulip") notification_bot = get_system_bot(settings.NOTIFICATION_BOT, realm.id) diff --git a/zerver/webhooks/heroku/tests.py b/zerver/webhooks/heroku/tests.py index 5933c12016..0162a9709f 100644 --- a/zerver/webhooks/heroku/tests.py +++ b/zerver/webhooks/heroku/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class HerokuHookTests(WebhookTestCase): - STREAM_NAME = "heroku" + CHANNEL_NAME = "heroku" URL_TEMPLATE = "/api/v1/external/heroku?stream={stream}&api_key={api_key}" def test_deployment(self) -> None: diff --git a/zerver/webhooks/homeassistant/tests.py b/zerver/webhooks/homeassistant/tests.py index 723753d97a..0445eee81d 100644 --- a/zerver/webhooks/homeassistant/tests.py +++ b/zerver/webhooks/homeassistant/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class HomeAssistantHookTests(WebhookTestCase): - STREAM_NAME = "homeassistant" + CHANNEL_NAME = "homeassistant" URL_TEMPLATE = "/api/v1/external/homeassistant?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "homeassistant" diff --git a/zerver/webhooks/ifttt/tests.py b/zerver/webhooks/ifttt/tests.py index 5faa917ea0..0fde007739 100644 --- a/zerver/webhooks/ifttt/tests.py +++ b/zerver/webhooks/ifttt/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class IFTTTHookTests(WebhookTestCase): - STREAM_NAME = "ifttt" + CHANNEL_NAME = "ifttt" URL_TEMPLATE = "/api/v1/external/ifttt?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "ifttt" VIEW_FUNCTION_NAME = "api_iftt_app_webhook" diff --git a/zerver/webhooks/insping/tests.py b/zerver/webhooks/insping/tests.py index c33d99c6a4..f11c7daf35 100644 --- a/zerver/webhooks/insping/tests.py +++ b/zerver/webhooks/insping/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class InspingHookTests(WebhookTestCase): - STREAM_NAME = "test" + CHANNEL_NAME = "test" URL_TEMPLATE = "/api/v1/external/insping?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "insping" diff --git a/zerver/webhooks/intercom/tests.py b/zerver/webhooks/intercom/tests.py index 920011db9f..e4e36ba9f6 100644 --- a/zerver/webhooks/intercom/tests.py +++ b/zerver/webhooks/intercom/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class IntercomWebHookTests(WebhookTestCase): - STREAM_NAME = "test" + CHANNEL_NAME = "test" URL_TEMPLATE = "/api/v1/external/intercom?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "intercom" diff --git a/zerver/webhooks/jira/tests.py b/zerver/webhooks/jira/tests.py index f617058d83..f48b9e907c 100644 --- a/zerver/webhooks/jira/tests.py +++ b/zerver/webhooks/jira/tests.py @@ -6,7 +6,7 @@ from zerver.lib.users import get_api_key class JiraHookTests(WebhookTestCase): - STREAM_NAME = "jira" + CHANNEL_NAME = "jira" URL_TEMPLATE = "/api/v1/external/jira?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "jira" @@ -65,9 +65,9 @@ Leo Franchi created [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/ self.assert_json_success(result) def test_created_with_stream_with_spaces_escaped(self) -> None: - self.STREAM_NAME = quote("jira alerts") + self.CHANNEL_NAME = quote("jira alerts") self.url = self.build_webhook_url() - self.subscribe(self.test_user, unquote(self.STREAM_NAME)) + self.subscribe(self.test_user, unquote(self.CHANNEL_NAME)) payload = self.get_body("created_v1") result = self.client_post(self.url, payload, content_type="application/json") @@ -86,9 +86,9 @@ Leo Franchi created [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/ self.assertEqual(msg.topic_name(), expected_topic_name) def test_created_with_stream_with_spaces_double_escaped(self) -> None: - self.STREAM_NAME = quote(quote("jira alerts")) + self.CHANNEL_NAME = quote(quote("jira alerts")) self.url = self.build_webhook_url() - self.subscribe(self.test_user, unquote(unquote(self.STREAM_NAME))) + self.subscribe(self.test_user, unquote(unquote(self.CHANNEL_NAME))) payload = self.get_body("created_v1") result = self.client_post(self.url, payload, content_type="application/json") diff --git a/zerver/webhooks/jotform/tests.py b/zerver/webhooks/jotform/tests.py index 2497cdd72d..11945a6877 100644 --- a/zerver/webhooks/jotform/tests.py +++ b/zerver/webhooks/jotform/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class JotformHookTests(WebhookTestCase): - STREAM_NAME = "test" + CHANNEL_NAME = "test" URL_TEMPLATE = "/api/v1/external/jotform?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "jotform" diff --git a/zerver/webhooks/json/tests.py b/zerver/webhooks/json/tests.py index 3c3463db7c..2851f8d45b 100644 --- a/zerver/webhooks/json/tests.py +++ b/zerver/webhooks/json/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class JsonHookTests(WebhookTestCase): - STREAM_NAME = "json" + CHANNEL_NAME = "json" URL_TEMPLATE = "/api/v1/external/json?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "json" diff --git a/zerver/webhooks/librato/tests.py b/zerver/webhooks/librato/tests.py index b1856e139f..af4ba26aba 100644 --- a/zerver/webhooks/librato/tests.py +++ b/zerver/webhooks/librato/tests.py @@ -6,7 +6,7 @@ from zerver.lib.test_classes import WebhookTestCase class LibratoHookTests(WebhookTestCase): - STREAM_NAME = "librato" + CHANNEL_NAME = "librato" URL_TEMPLATE = "/api/v1/external/librato?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "librato" IS_ATTACHMENT = False diff --git a/zerver/webhooks/lidarr/tests.py b/zerver/webhooks/lidarr/tests.py index 16c723ced4..cf74db9721 100644 --- a/zerver/webhooks/lidarr/tests.py +++ b/zerver/webhooks/lidarr/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class LidarrHookTests(WebhookTestCase): - STREAM_NAME = "lidarr" + CHANNEL_NAME = "lidarr" URL_TEMPLATE = "/api/v1/external/lidarr?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "lidarr" diff --git a/zerver/webhooks/linear/tests.py b/zerver/webhooks/linear/tests.py index 70c5954943..325d66af83 100644 --- a/zerver/webhooks/linear/tests.py +++ b/zerver/webhooks/linear/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class LinearHookTests(WebhookTestCase): - STREAM_NAME = "Linear" + CHANNEL_NAME = "Linear" URL_TEMPLATE = "/api/v1/external/linear?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "linear" diff --git a/zerver/webhooks/mention/tests.py b/zerver/webhooks/mention/tests.py index 261ac59cea..da2fed593b 100644 --- a/zerver/webhooks/mention/tests.py +++ b/zerver/webhooks/mention/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class MentionHookTests(WebhookTestCase): - STREAM_NAME = "test" + CHANNEL_NAME = "test" URL_TEMPLATE = "/api/v1/external/mention?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "mention" diff --git a/zerver/webhooks/netlify/tests.py b/zerver/webhooks/netlify/tests.py index 99254797c1..35a5459806 100644 --- a/zerver/webhooks/netlify/tests.py +++ b/zerver/webhooks/netlify/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class NetlifyHookTests(WebhookTestCase): - STREAM_NAME = "netlify" + CHANNEL_NAME = "netlify" URL_TEMPLATE = "/api/v1/external/netlify?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "netlify" diff --git a/zerver/webhooks/newrelic/tests.py b/zerver/webhooks/newrelic/tests.py index 8d94b7c6d2..98a9c03327 100644 --- a/zerver/webhooks/newrelic/tests.py +++ b/zerver/webhooks/newrelic/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class NewRelicHookTests(WebhookTestCase): - STREAM_NAME = "newrelic" + CHANNEL_NAME = "newrelic" URL_TEMPLATE = "/api/v1/external/newrelic?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "newrelic" diff --git a/zerver/webhooks/opbeat/tests.py b/zerver/webhooks/opbeat/tests.py index 588a713ee9..6ef1f2e4a2 100644 --- a/zerver/webhooks/opbeat/tests.py +++ b/zerver/webhooks/opbeat/tests.py @@ -4,7 +4,7 @@ from zerver.webhooks.opbeat.view import get_value class OpbeatHookTests(WebhookTestCase): - STREAM_NAME = "opbeat" + CHANNEL_NAME = "opbeat" URL_TEMPLATE = "/api/v1/external/opbeat?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "opbeat" diff --git a/zerver/webhooks/opencollective/tests.py b/zerver/webhooks/opencollective/tests.py index 63a6b7c900..b7de100466 100644 --- a/zerver/webhooks/opencollective/tests.py +++ b/zerver/webhooks/opencollective/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class OpenCollectiveHookTests(WebhookTestCase): - STREAM_NAME = "test" + CHANNEL_NAME = "test" URL_TEMPLATE = "/api/v1/external/opencollective?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "opencollective" diff --git a/zerver/webhooks/opsgenie/tests.py b/zerver/webhooks/opsgenie/tests.py index c0554633aa..8dbc408918 100644 --- a/zerver/webhooks/opsgenie/tests.py +++ b/zerver/webhooks/opsgenie/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class OpsgenieHookTests(WebhookTestCase): - STREAM_NAME = "opsgenie" + CHANNEL_NAME = "opsgenie" URL_TEMPLATE = "/api/v1/external/opsgenie?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "opsgenie" diff --git a/zerver/webhooks/pagerduty/tests.py b/zerver/webhooks/pagerduty/tests.py index 5d1ff39ffc..6d3d4517a5 100644 --- a/zerver/webhooks/pagerduty/tests.py +++ b/zerver/webhooks/pagerduty/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class PagerDutyHookTests(WebhookTestCase): - STREAM_NAME = "pagerduty" + CHANNEL_NAME = "pagerduty" URL_TEMPLATE = "/api/v1/external/pagerduty?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "pagerduty" diff --git a/zerver/webhooks/papertrail/tests.py b/zerver/webhooks/papertrail/tests.py index 7053d1dcd9..51e9161e55 100644 --- a/zerver/webhooks/papertrail/tests.py +++ b/zerver/webhooks/papertrail/tests.py @@ -6,7 +6,7 @@ from zerver.lib.test_classes import WebhookTestCase class PapertrailHookTests(WebhookTestCase): - STREAM_NAME = "papertrail" + CHANNEL_NAME = "papertrail" URL_TEMPLATE = "/api/v1/external/papertrail?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "papertrail" diff --git a/zerver/webhooks/patreon/tests.py b/zerver/webhooks/patreon/tests.py index 9110f0969c..65a224831c 100644 --- a/zerver/webhooks/patreon/tests.py +++ b/zerver/webhooks/patreon/tests.py @@ -13,7 +13,7 @@ IGNORED_EVENTS = [ class PatreonHookTests(WebhookTestCase): - STREAM_NAME = "Patreon" + CHANNEL_NAME = "Patreon" URL_TEMPLATE = "/api/v1/external/patreon?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "patreon" diff --git a/zerver/webhooks/pingdom/tests.py b/zerver/webhooks/pingdom/tests.py index 4e6286e5a8..70dd092fcf 100644 --- a/zerver/webhooks/pingdom/tests.py +++ b/zerver/webhooks/pingdom/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class PingdomHookTests(WebhookTestCase): - STREAM_NAME = "pingdom" + CHANNEL_NAME = "pingdom" URL_TEMPLATE = "/api/v1/external/pingdom?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "pingdom" diff --git a/zerver/webhooks/pivotal/tests.py b/zerver/webhooks/pivotal/tests.py index 3356e5b2c8..6dfffd6002 100644 --- a/zerver/webhooks/pivotal/tests.py +++ b/zerver/webhooks/pivotal/tests.py @@ -9,7 +9,7 @@ from zerver.webhooks.pivotal.view import api_pivotal_webhook_v5 class PivotalV3HookTests(WebhookTestCase): - STREAM_NAME = "pivotal" + CHANNEL_NAME = "pivotal" URL_TEMPLATE = "/api/v1/external/pivotal?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "pivotal" @@ -112,7 +112,7 @@ class PivotalV3HookTests(WebhookTestCase): class PivotalV5HookTests(WebhookTestCase): - STREAM_NAME = "pivotal" + CHANNEL_NAME = "pivotal" URL_TEMPLATE = "/api/v1/external/pivotal?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "pivotal" diff --git a/zerver/webhooks/radarr/tests.py b/zerver/webhooks/radarr/tests.py index 402bef73e5..3990b98b66 100644 --- a/zerver/webhooks/radarr/tests.py +++ b/zerver/webhooks/radarr/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class RadarrHookTests(WebhookTestCase): - STREAM_NAME = "radarr" + CHANNEL_NAME = "radarr" URL_TEMPLATE = "/api/v1/external/radarr?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "radarr" diff --git a/zerver/webhooks/raygun/tests.py b/zerver/webhooks/raygun/tests.py index a89a919de3..ba1f148084 100644 --- a/zerver/webhooks/raygun/tests.py +++ b/zerver/webhooks/raygun/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class RaygunHookTests(WebhookTestCase): - STREAM_NAME = "raygun" + CHANNEL_NAME = "raygun" URL_TEMPLATE = "/api/v1/external/raygun?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "raygun" diff --git a/zerver/webhooks/reviewboard/tests.py b/zerver/webhooks/reviewboard/tests.py index 07d43ea598..e2feb84f5c 100644 --- a/zerver/webhooks/reviewboard/tests.py +++ b/zerver/webhooks/reviewboard/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class ReviewBoardHookTests(WebhookTestCase): - STREAM_NAME = "reviewboard" + CHANNEL_NAME = "reviewboard" URL_TEMPLATE = "/api/v1/external/reviewboard?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "reviewboard" diff --git a/zerver/webhooks/rhodecode/tests.py b/zerver/webhooks/rhodecode/tests.py index 4158474ab1..adb8a2e9e7 100644 --- a/zerver/webhooks/rhodecode/tests.py +++ b/zerver/webhooks/rhodecode/tests.py @@ -5,7 +5,7 @@ from zerver.lib.webhooks.git import COMMITS_LIMIT class RhodecodeHookTests(WebhookTestCase): - STREAM_NAME = "rhodecode" + CHANNEL_NAME = "rhodecode" URL_TEMPLATE = "/api/v1/external/rhodecode?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "rhodecode" diff --git a/zerver/webhooks/rundeck/tests.py b/zerver/webhooks/rundeck/tests.py index 43ab9680a7..afc3858919 100644 --- a/zerver/webhooks/rundeck/tests.py +++ b/zerver/webhooks/rundeck/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class RundeckHookTests(WebhookTestCase): - STREAM_NAME = "Rundeck" + CHANNEL_NAME = "Rundeck" TOPIC_NAME = "Global Log Filter Usage" URL_TEMPLATE = "/api/v1/external/rundeck?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "rundeck" diff --git a/zerver/webhooks/semaphore/tests.py b/zerver/webhooks/semaphore/tests.py index c7744fe80e..85af21edd7 100644 --- a/zerver/webhooks/semaphore/tests.py +++ b/zerver/webhooks/semaphore/tests.py @@ -6,7 +6,7 @@ from zerver.lib.test_classes import WebhookTestCase class SemaphoreHookTests(WebhookTestCase): - STREAM_NAME = "semaphore" + CHANNEL_NAME = "semaphore" URL_TEMPLATE = "/api/v1/external/semaphore?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "semaphore" diff --git a/zerver/webhooks/sentry/tests.py b/zerver/webhooks/sentry/tests.py index 95d832ed6b..60dbe9211d 100644 --- a/zerver/webhooks/sentry/tests.py +++ b/zerver/webhooks/sentry/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class SentryHookTests(WebhookTestCase): - STREAM_NAME = "sentry" + CHANNEL_NAME = "sentry" URL_TEMPLATE = "/api/v1/external/sentry?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "sentry" diff --git a/zerver/webhooks/slack/tests.py b/zerver/webhooks/slack/tests.py index eb5bdb80d0..7ab84756db 100644 --- a/zerver/webhooks/slack/tests.py +++ b/zerver/webhooks/slack/tests.py @@ -7,7 +7,7 @@ EXPECTED_MESSAGE = "**slack_user**: test" class SlackWebhookTests(WebhookTestCase): - STREAM_NAME = "slack" + CHANNEL_NAME = "slack" URL_TEMPLATE = "/api/v1/external/slack?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "slack" @@ -50,7 +50,7 @@ class SlackWebhookTests(WebhookTestCase): ) def test_slack_channels_map_to_topics_false(self) -> None: - self.STREAM_NAME = "general" + self.CHANNEL_NAME = "general" self.url = self.build_webhook_url(channels_map_to_topics="0") self.check_webhook( "message_info", @@ -60,7 +60,7 @@ class SlackWebhookTests(WebhookTestCase): ) def test_slack_channels_map_to_topics_false_and_user_specified_topic(self) -> None: - self.STREAM_NAME = "general" + self.CHANNEL_NAME = "general" self.url = self.build_webhook_url(topic="test", channels_map_to_topics="0") expected_topic_name = "test" self.check_webhook( diff --git a/zerver/webhooks/slack_incoming/tests.py b/zerver/webhooks/slack_incoming/tests.py index 9373f9d886..416c9b3240 100644 --- a/zerver/webhooks/slack_incoming/tests.py +++ b/zerver/webhooks/slack_incoming/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class SlackIncomingHookTests(WebhookTestCase): - STREAM_NAME = "slack_incoming" + CHANNEL_NAME = "slack_incoming" URL_TEMPLATE = "/api/v1/external/slack_incoming?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "slack_incoming" @@ -28,7 +28,7 @@ Hello, world. ("*foo*a*bar*", "*foo*a*bar*"), ("some _foo_ word", "some *foo* word"), ] - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) for input_value, output_value in tests: payload = {"text": input_value} msg = self.send_webhook_payload( @@ -39,7 +39,7 @@ Hello, world. ) self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name="(no topic)", content=output_value, ) diff --git a/zerver/webhooks/solano/tests.py b/zerver/webhooks/solano/tests.py index 4f3bbf3261..b6968bf6c2 100644 --- a/zerver/webhooks/solano/tests.py +++ b/zerver/webhooks/solano/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class SolanoHookTests(WebhookTestCase): - STREAM_NAME = "solano labs" + CHANNEL_NAME = "solano labs" URL_TEMPLATE = "/api/v1/external/solano?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "solano" diff --git a/zerver/webhooks/sonarqube/tests.py b/zerver/webhooks/sonarqube/tests.py index b6ec667554..c2b11aa1fe 100644 --- a/zerver/webhooks/sonarqube/tests.py +++ b/zerver/webhooks/sonarqube/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class SonarqubeHookTests(WebhookTestCase): - STREAM_NAME = "SonarQube" + CHANNEL_NAME = "SonarQube" URL_TEMPLATE = "/api/v1/external/sonarqube?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "sonarqube" diff --git a/zerver/webhooks/sonarr/tests.py b/zerver/webhooks/sonarr/tests.py index 0e000c77e7..4512532a52 100644 --- a/zerver/webhooks/sonarr/tests.py +++ b/zerver/webhooks/sonarr/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class SonarrHookTests(WebhookTestCase): - STREAM_NAME = "sonarr" + CHANNEL_NAME = "sonarr" URL_TEMPLATE = "/api/v1/external/sonarr?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "sonarr" diff --git a/zerver/webhooks/splunk/tests.py b/zerver/webhooks/splunk/tests.py index c03f138bf4..7683b422c3 100644 --- a/zerver/webhooks/splunk/tests.py +++ b/zerver/webhooks/splunk/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class SplunkHookTests(WebhookTestCase): - STREAM_NAME = "splunk" + CHANNEL_NAME = "splunk" URL_TEMPLATE = "/api/v1/external/splunk?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "splunk" diff --git a/zerver/webhooks/statuspage/tests.py b/zerver/webhooks/statuspage/tests.py index 4351ec585e..16eec07e64 100644 --- a/zerver/webhooks/statuspage/tests.py +++ b/zerver/webhooks/statuspage/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class StatuspageHookTests(WebhookTestCase): - STREAM_NAME = "statuspage-test" + CHANNEL_NAME = "statuspage-test" URL_TEMPLATE = "/api/v1/external/statuspage?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "statuspage" diff --git a/zerver/webhooks/stripe/tests.py b/zerver/webhooks/stripe/tests.py index 062cbf7ed7..49cd4b9cc7 100644 --- a/zerver/webhooks/stripe/tests.py +++ b/zerver/webhooks/stripe/tests.py @@ -5,7 +5,7 @@ from zerver.lib.test_classes import WebhookTestCase class StripeHookTests(WebhookTestCase): - STREAM_NAME = "test" + CHANNEL_NAME = "test" URL_TEMPLATE = "/api/v1/external/stripe?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "stripe" diff --git a/zerver/webhooks/taiga/tests.py b/zerver/webhooks/taiga/tests.py index 04929bcaa0..c72832f498 100644 --- a/zerver/webhooks/taiga/tests.py +++ b/zerver/webhooks/taiga/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class TaigaHookTests(WebhookTestCase): - STREAM_NAME = "taiga" + CHANNEL_NAME = "taiga" TOPIC_NAME = "subject" URL_TEMPLATE = "/api/v1/external/taiga?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "taiga" diff --git a/zerver/webhooks/teamcity/tests.py b/zerver/webhooks/teamcity/tests.py index 980442d8b0..7910cf1dac 100644 --- a/zerver/webhooks/teamcity/tests.py +++ b/zerver/webhooks/teamcity/tests.py @@ -9,7 +9,7 @@ from zerver.webhooks.teamcity.view import MISCONFIGURED_PAYLOAD_TYPE_ERROR_MESSA class TeamCityHookTests(WebhookTestCase): - STREAM_NAME = "teamcity" + CHANNEL_NAME = "teamcity" URL_TEMPLATE = "/api/v1/external/teamcity?stream={stream}&api_key={api_key}" TOPIC_NAME = "Project :: Compile" WEBHOOK_DIR_NAME = "teamcity" diff --git a/zerver/webhooks/thinkst/tests.py b/zerver/webhooks/thinkst/tests.py index e21eade710..b7ef318e95 100644 --- a/zerver/webhooks/thinkst/tests.py +++ b/zerver/webhooks/thinkst/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class ThinkstHookTests(WebhookTestCase): - STREAM_NAME = "thinkst" + CHANNEL_NAME = "thinkst" URL_TEMPLATE = "/api/v1/external/thinkst?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "thinkst" diff --git a/zerver/webhooks/transifex/tests.py b/zerver/webhooks/transifex/tests.py index e691b53870..2c66e7b0ab 100644 --- a/zerver/webhooks/transifex/tests.py +++ b/zerver/webhooks/transifex/tests.py @@ -6,7 +6,7 @@ from zerver.lib.test_classes import WebhookTestCase class TransifexHookTests(WebhookTestCase): - STREAM_NAME = "transifex" + CHANNEL_NAME = "transifex" URL_TEMPLATE = "/api/v1/external/transifex?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "transifex" diff --git a/zerver/webhooks/travis/tests.py b/zerver/webhooks/travis/tests.py index aa6b13feaf..c16ad21dac 100644 --- a/zerver/webhooks/travis/tests.py +++ b/zerver/webhooks/travis/tests.py @@ -6,7 +6,7 @@ from zerver.lib.test_classes import WebhookTestCase class TravisHookTests(WebhookTestCase): - STREAM_NAME = "travis" + CHANNEL_NAME = "travis" URL_TEMPLATE = "/api/v1/external/travis?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "travis" TOPIC_NAME = "builds" diff --git a/zerver/webhooks/trello/tests.py b/zerver/webhooks/trello/tests.py index ca9239f8e9..6105096a09 100644 --- a/zerver/webhooks/trello/tests.py +++ b/zerver/webhooks/trello/tests.py @@ -7,7 +7,7 @@ from zerver.lib.test_classes import WebhookTestCase class TrelloHookTests(WebhookTestCase): - STREAM_NAME = "trello" + CHANNEL_NAME = "trello" URL_TEMPLATE = "/api/v1/external/trello?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "trello" diff --git a/zerver/webhooks/updown/tests.py b/zerver/webhooks/updown/tests.py index 8502dde5c9..c9a8cb6db2 100644 --- a/zerver/webhooks/updown/tests.py +++ b/zerver/webhooks/updown/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class UpdownHookTests(WebhookTestCase): - STREAM_NAME = "updown" + CHANNEL_NAME = "updown" URL_TEMPLATE = "/api/v1/external/updown?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "updown" @@ -27,7 +27,7 @@ class UpdownHookTests(WebhookTestCase): down_content = "Service is `down`. It returned a 500 error at 2016-02-07 13:11:43 UTC." up_content = "Service is `up` again after 1 second." - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) payload = self.get_body("check_multiple_events") msg = self.send_webhook_payload( @@ -40,7 +40,7 @@ class UpdownHookTests(WebhookTestCase): msg = self.get_second_to_last_message() self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=topic_name, content=down_content, ) @@ -48,7 +48,7 @@ class UpdownHookTests(WebhookTestCase): msg = self.get_last_message() self.assert_stream_message( message=msg, - stream_name=self.STREAM_NAME, + stream_name=self.CHANNEL_NAME, topic_name=topic_name, content=up_content, ) diff --git a/zerver/webhooks/uptimerobot/tests.py b/zerver/webhooks/uptimerobot/tests.py index 8da89435b0..1abab1900e 100644 --- a/zerver/webhooks/uptimerobot/tests.py +++ b/zerver/webhooks/uptimerobot/tests.py @@ -5,7 +5,7 @@ from zerver.webhooks.uptimerobot.view import MISCONFIGURED_PAYLOAD_ERROR_MESSAGE class UptimeRobotHookTests(WebhookTestCase): - STREAM_NAME = "uptimerobot" + CHANNEL_NAME = "uptimerobot" URL_TEMPLATE = "/api/v1/external/uptimerobot?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "uptimerobot" diff --git a/zerver/webhooks/wekan/tests.py b/zerver/webhooks/wekan/tests.py index f8707409bc..da7694393b 100644 --- a/zerver/webhooks/wekan/tests.py +++ b/zerver/webhooks/wekan/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class WekanHookTests(WebhookTestCase): - STREAM_NAME = "wekan" + CHANNEL_NAME = "wekan" URL_TEMPLATE = "/api/v1/external/wekan?stream={stream}&api_key={api_key}" FIXTURE_DIR_NAME = "wekan" diff --git a/zerver/webhooks/wordpress/tests.py b/zerver/webhooks/wordpress/tests.py index ed99aeb3b6..21662db8e1 100644 --- a/zerver/webhooks/wordpress/tests.py +++ b/zerver/webhooks/wordpress/tests.py @@ -4,7 +4,7 @@ from zerver.lib.test_classes import WebhookTestCase class WordPressHookTests(WebhookTestCase): - STREAM_NAME = "wordpress" + CHANNEL_NAME = "wordpress" URL_TEMPLATE = "/api/v1/external/wordpress?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "wordpress" @@ -84,7 +84,7 @@ class WordPressHookTests(WebhookTestCase): # return if no params are sent. The fixture for this test is an empty file. # subscribe to the target stream - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) # post to the webhook url result = self.client_post( @@ -100,7 +100,7 @@ class WordPressHookTests(WebhookTestCase): # Similar to unknown_action_no_data, except the fixture contains valid blog post # params but without the hook parameter. This should also return an error. - self.subscribe(self.test_user, self.STREAM_NAME) + self.subscribe(self.test_user, self.CHANNEL_NAME) result = self.client_post( self.url, self.get_body("unknown_action_no_hook_provided"), diff --git a/zerver/webhooks/zabbix/tests.py b/zerver/webhooks/zabbix/tests.py index 218f028c42..9b73c9ddb2 100644 --- a/zerver/webhooks/zabbix/tests.py +++ b/zerver/webhooks/zabbix/tests.py @@ -5,7 +5,7 @@ from zerver.webhooks.zabbix.view import MISCONFIGURED_PAYLOAD_ERROR_MESSAGE class ZabbixHookTests(WebhookTestCase): - STREAM_NAME = "zabbix" + CHANNEL_NAME = "zabbix" URL_TEMPLATE = "/api/v1/external/zabbix?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "zabbix" diff --git a/zerver/webhooks/zapier/tests.py b/zerver/webhooks/zapier/tests.py index 2a72deba5d..7662895cbd 100644 --- a/zerver/webhooks/zapier/tests.py +++ b/zerver/webhooks/zapier/tests.py @@ -2,7 +2,7 @@ from zerver.lib.test_classes import WebhookTestCase class ZapierHookTests(WebhookTestCase): - STREAM_NAME = "zapier" + CHANNEL_NAME = "zapier" URL_TEMPLATE = "/api/v1/external/zapier?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "zapier" @@ -25,7 +25,7 @@ class ZapierHookTests(WebhookTestCase): class ZapierZulipAppTests(WebhookTestCase): - STREAM_NAME = "zapier" + CHANNEL_NAME = "zapier" URL_TEMPLATE = "/api/v1/external/zapier?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "zapier" diff --git a/zerver/webhooks/zendesk/tests.py b/zerver/webhooks/zendesk/tests.py index 4671f8e16b..6fa18f0326 100644 --- a/zerver/webhooks/zendesk/tests.py +++ b/zerver/webhooks/zendesk/tests.py @@ -6,7 +6,7 @@ from zerver.lib.test_classes import WebhookTestCase class ZenDeskHookTests(WebhookTestCase): - STREAM_NAME = "zendesk" + CHANNEL_NAME = "zendesk" URL_TEMPLATE = "/api/v1/external/zendesk?stream={stream}" @override @@ -15,7 +15,7 @@ class ZenDeskHookTests(WebhookTestCase): "ticket_title": self.TICKET_TITLE, "ticket_id": str(self.TICKET_ID), "message": self.MESSAGE, - "stream": self.STREAM_NAME, + "stream": self.CHANNEL_NAME, } def do_test(self, expected_topic: str, expected_message: str) -> None: