Add message.topic_name() helper function.

This little helper will facilitate adding a new Topic
table in the future.
This commit is contained in:
Steve Howell
2016-07-14 08:48:11 -07:00
committed by Tim Abbott
parent a5b9e3b893
commit 9d7716f368
6 changed files with 15 additions and 8 deletions

View File

@@ -65,7 +65,7 @@ class WebhookTestCase(AuthedTestCase):
def do_test_subject(self, msg, expected_subject):
# type: (Message, Optional[text_type]) -> None
if expected_subject is not None:
self.assertEqual(msg.subject, expected_subject)
self.assertEqual(msg.topic_name(), expected_subject)
def do_test_message(self, msg, expected_message):
# type: (Message, Optional[text_type]) -> None
@@ -96,7 +96,7 @@ class JiraHookTests(WebhookTestCase):
self.get_body('created'),
stream_name="jira_custom",
content_type="application/json")
self.assertEqual(msg.subject, "BUG-15: New bug with hook")
self.assertEqual(msg.topic_name(), "BUG-15: New bug with hook")
self.assertEqual(msg.content, """Leo Franchi **created** [BUG-15](http://lfranchi.com:8080/browse/BUG-15) priority Major, assigned to @**no one**:
> New bug with hook""")