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.

webhooks: Rename STREAM_NAME to CHANNEL_NAME in tests.

Mateusz Manderadc31347ac4a3
diff --git a/api_docs/incoming-webhooks-walkthrough.md b/api_docs/incoming-webhooks-walkthrough.md
index 64d11a1ce7d..b2aafafb2f2 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 fcba2af4641..5ef8fb67915 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 = "[email protected]"
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 675e7882a7a..a636f3bac1e 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 bb98c567e6e..24b7c659dac 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 2d7453f75c4..e395c631a9e 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 5a8abcac5fc..a5ab2dd6d41 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 b5fa98a307e..76146d912ae 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 481e2e634cd..78c6d8c28f1 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 174a994f42d..7dfc62fa67a 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 b537210e515..9455b5bbc82 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 638844180bc..c6a5e8bdf68 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 4d6e4527243..23a1378eaac 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 e73da00c9c2..d43130abe19 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 b7c70567902..4684e1118cf 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 7449dad757d..b25bab5ec64 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 8d96b5b0786..0628c12c80c 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 23c7d94733e..0d428bdd9cd 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 b5b5cac00c4..7a09795bd12 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 046a15b8158..a4fcae2563f 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 605cff48363..c3c22061175 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 58249a5b643..44f532e32b9 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 212be2bcdc0..69bc770c64b 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 0140230f77d..964126d4bcd 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 6001f6e9800..b9a11aa8821 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 633c52d439b..b9ed308861b 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 7a8f4be7a9c..973d098a8a4 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 1189bd33f89..7ec64552a85 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 134fa1248ad..be22b84848a 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 2ac1c623a12..c8edf023c02 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 a4c4983d091..250ba13a3be 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 154f741e8d3..e7202ac9ca5 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 5c7167b7069..c6825f71248 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 7326fd59a3a..9bb0c06f768 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 6d83eb1922e..01690e09472 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 f2f2f1333f2..739be052dd0 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 86bef4b406c..3c98140e22a 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 1a6a4373c3f..0e822768a98 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 e071637b616..803441521cf 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 71945fd7818..73fd9904776 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 ffb7068fa2b..3c7ef99fc26 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 7774bbc44ba..83c0466d306 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 0a22b0fdaad..891bcd14e76 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 c58f52415f0..a3c7d0f09ca 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 5933c120163..0162a9709f8 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 723753d97a2..0445eee81de 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 5faa917ea0f..0fde007739b 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 c33d99c6a48..f11c7daf35b 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 920011db9f2..e4e36ba9f68 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 f617058d834..f48b9e907cb 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 2497cdd72d3..11945a68777 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 3c3463db7c7..2851f8d45b3 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 b1856e139fd..af4ba26aba1 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 16c723ced4d..cf74db97215 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 70c59549435..325d66af83b 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 261ac59ceaf..da2fed593bd 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 99254797c19..35a54598061 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 8d94b7c6d21..98a9c033273 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 588a713ee94..6ef1f2e4a29 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 63a6b7c900a..b7de100466d 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 c0554633aac..8dbc408918d 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 5d1ff39ffc5..6d3d4517a5e 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 7053d1dcd90..51e9161e55d 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 9110f0969cd..65a224831c1 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 4e6286e5a88..70dd092fcf0 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 3356e5b2c84..6dfffd60025 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 402bef73e54..3990b98b663 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 a89a919de36..ba1f148084a 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 07d43ea5980..e2feb84f5ca 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 4158474ab13..adb8a2e9e70 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 43ab9680a7a..afc38589190 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 c7744fe80e6..85af21edd78 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 95d832ed6b2..60dbe9211df 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 eb5bdb80d0a..7ab84756db6 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 9373f9d8866..416c9b32406 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 4f3bbf3261e..b6968bf6c24 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 b6ec6675541..c2b11aa1fee 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 0e000c77e73..4512532a529 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 c03f138bf49..7683b422c3d 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 4351ec585e3..16eec07e646 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 062cbf7ed7a..49cd4b9cc7f 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 04929bcaa0b..c72832f498f 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 980442d8b0c..7910cf1dace 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 e21eade710f..b7ef318e956 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 e691b53870b..2c66e7b0abf 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 aa6b13feafb..c16ad21dac5 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 ca9239f8e91..6105096a09e 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 8502dde5c9d..c9a8cb6db24 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 8da89435b0f..1abab1900ef 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 f8707409bcc..da7694393b9 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 ed99aeb3b6d..21662db8e19 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 218f028c421..9b73c9ddb2f 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 2a72deba5d1..7662895cbd8 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 4671f8e16b9..6fa18f03268 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: