webhooks: Rename stream_name to channel_name arg.

This commit is contained in:
Mateusz Mandera 2024-05-04 22:24:07 +02:00 committed by Tim Abbott
parent fef299510f
commit d7b2655ad2
8 changed files with 17 additions and 17 deletions

View File

@ -2234,7 +2234,7 @@ one or more new messages.
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=expected_topic_name, topic_name=expected_topic_name,
content=expected_message, content=expected_message,
) )
@ -2242,11 +2242,11 @@ one or more new messages.
def assert_channel_message( def assert_channel_message(
self, self,
message: Message, message: Message,
stream_name: str, channel_name: str,
topic_name: str, topic_name: str,
content: str, content: str,
) -> None: ) -> None:
self.assert_message_stream_name(message, stream_name) self.assert_message_stream_name(message, channel_name)
self.assertEqual(message.topic_name(), topic_name) self.assertEqual(message.topic_name(), topic_name)
self.assertEqual(message.content, content) self.assertEqual(message.content, content)

View File

@ -175,7 +175,7 @@ class WebhookURLConfigurationTestCase(WebhookTestCase):
msg = self.get_last_message() msg = self.get_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name="helloworld_renamed", channel_name="helloworld_renamed",
topic_name=expected_topic_name, topic_name=expected_topic_name,
content=expected_message, content=expected_message,
) )

View File

@ -292,7 +292,7 @@ class Bitbucket2HookTests(WebhookTestCase):
msg = self.get_second_to_last_message() msg = self.get_second_to_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=TOPIC, topic_name=TOPIC,
content=expected_message.format(name="a"), content=expected_message.format(name="a"),
) )
@ -300,7 +300,7 @@ class Bitbucket2HookTests(WebhookTestCase):
msg = self.get_last_message() msg = self.get_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=TOPIC, topic_name=TOPIC,
content=expected_message.format(name="b"), content=expected_message.format(name="b"),
) )
@ -320,7 +320,7 @@ class Bitbucket2HookTests(WebhookTestCase):
msg = self.get_second_to_last_message() msg = self.get_second_to_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=TOPIC_BRANCH_EVENTS, 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))", 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() msg = self.get_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=TOPIC, topic_name=TOPIC,
content="Tomasz pushed tag [a](https://bitbucket.org/kolaszek/repository-name/commits/tag/a).", content="Tomasz pushed tag [a](https://bitbucket.org/kolaszek/repository-name/commits/tag/a).",
) )
@ -350,7 +350,7 @@ class Bitbucket2HookTests(WebhookTestCase):
msg = self.get_second_to_last_message() msg = self.get_second_to_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=TOPIC_BRANCH_EVENTS, 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))", 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() msg = self.get_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=TOPIC, topic_name=TOPIC,
content="Tomasz pushed tag [a](https://bitbucket.org/kolaszek/repository-name/commits/tag/a).", content="Tomasz pushed tag [a](https://bitbucket.org/kolaszek/repository-name/commits/tag/a).",
) )

View File

@ -94,7 +94,7 @@ class Bitbucket3HookTests(WebhookTestCase):
msg = self.get_second_to_last_message() msg = self.get_second_to_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=TOPIC_BRANCH_EVENTS.format(branch="branch1"), topic_name=TOPIC_BRANCH_EVENTS.format(branch="branch1"),
content=branch1_content, content=branch1_content,
) )
@ -102,7 +102,7 @@ class Bitbucket3HookTests(WebhookTestCase):
msg = self.get_last_message() msg = self.get_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=TOPIC_BRANCH_EVENTS.format(branch="master"), topic_name=TOPIC_BRANCH_EVENTS.format(branch="master"),
content=master_content, content=master_content,
) )

View File

@ -560,7 +560,7 @@ A temporary team so that I can get some webhook fixtures!
self.assert_channel_message( self.assert_channel_message(
message=stream_message, message=stream_message,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name="team My Team", topic_name="team My Team",
content="Team has changes to `bogus_key1/bogus_key2` data.", content="Team has changes to `bogus_key1/bogus_key2` data.",
) )

View File

@ -28,7 +28,7 @@ Leo Franchi created [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/
""".strip() """.strip()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name="jira_custom", channel_name="jira_custom",
topic_name="BUG-15: New bug with hook", topic_name="BUG-15: New bug with hook",
content=expected_content, content=expected_content,
) )

View File

@ -39,7 +39,7 @@ Hello, world.
) )
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name="(no topic)", topic_name="(no topic)",
content=output_value, content=output_value,
) )

View File

@ -40,7 +40,7 @@ class UpdownHookTests(WebhookTestCase):
msg = self.get_second_to_last_message() msg = self.get_second_to_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=topic_name, topic_name=topic_name,
content=down_content, content=down_content,
) )
@ -48,7 +48,7 @@ class UpdownHookTests(WebhookTestCase):
msg = self.get_last_message() msg = self.get_last_message()
self.assert_channel_message( self.assert_channel_message(
message=msg, message=msg,
stream_name=self.CHANNEL_NAME, channel_name=self.CHANNEL_NAME,
topic_name=topic_name, topic_name=topic_name,
content=up_content, content=up_content,
) )