Add underscores to thumbs_up and thumbs_down emoji

This commit is contained in:
Josh Mandel 2018-02-06 20:26:08 -06:00 committed by Tim Abbott
parent db152da7c9
commit 15eaafa50f
6 changed files with 17 additions and 17 deletions

View File

@ -17,7 +17,7 @@ class SolanoHookTests(WebhookTestCase):
expected_message = (u"Author: solano-ci[bot]@users.noreply.github.com\n"
u"Commit: [5f438401eb7cc7268cbc28438bfa70bb99f48a03]"
u"(github.com/fazerlicourice7/solano/commit/5f438401eb7cc7268"
u"cbc28438bfa70bb99f48a03)\nBuild status: failed :thumbsdown:\n"
u"cbc28438bfa70bb99f48a03)\nBuild status: failed :thumbs_down:\n"
u"[Build Log](https://ci.solanolabs.com:443/reports/3316175)")
self.send_and_test_stream_message('build_001', expected_topic, expected_message,
@ -30,7 +30,7 @@ class SolanoHookTests(WebhookTestCase):
expected_topic = u'build update'
expected_message = (u"Author: Unknown\nCommit: [5d0b92e26448a9e91db794bfed4b8c3556eabc4e]"
u"(bitbucket.org/fazerlicourice7/test/commits/5d0b92e26448a9e91db794bfed"
u"4b8c3556eabc4e)\nBuild status: failed :thumbsdown:\n"
u"4b8c3556eabc4e)\nBuild status: failed :thumbs_down:\n"
u"[Build Log](https://ci.solanolabs.com:443/reports/3316723)")
self.send_and_test_stream_message('build_002', expected_topic, expected_message,

View File

@ -34,9 +34,9 @@ def api_solano_webhook(request: HttpRequest, user_profile: UserProfile,
neutral_status = ['running']
emoji = ''
if status in good_status:
emoji = ':thumbsup:'
emoji = ':thumbs_up:'
elif status in bad_status:
emoji = ':thumbsdown:'
emoji = ':thumbs_down:'
elif status in neutral_status:
emoji = ':arrows_counterclockwise:'
else:

View File

@ -11,23 +11,23 @@ class TeamcityHookTests(WebhookTestCase):
FIXTURE_DIR_NAME = 'teamcity'
def test_teamcity_success(self) -> None:
expected_message = u"Project :: Compile build 5535 - CL 123456 was successful! :thumbsup:\nDetails: [changes](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952&tab=buildChangesDiv), [build log](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952)"
expected_message = u"Project :: Compile build 5535 - CL 123456 was successful! :thumbs_up:\nDetails: [changes](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952&tab=buildChangesDiv), [build log](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952)"
self.send_and_test_stream_message('success', self.SUBJECT, expected_message)
def test_teamcity_broken(self) -> None:
expected_message = u"Project :: Compile build 5535 - CL 123456 is broken with status Exit code 1 (new)! :thumbsdown:\nDetails: [changes](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952&tab=buildChangesDiv), [build log](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952)"
expected_message = u"Project :: Compile build 5535 - CL 123456 is broken with status Exit code 1 (new)! :thumbs_down:\nDetails: [changes](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952&tab=buildChangesDiv), [build log](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952)"
self.send_and_test_stream_message('broken', self.SUBJECT, expected_message)
def test_teamcity_failure(self) -> None:
expected_message = u"Project :: Compile build 5535 - CL 123456 is still broken with status Exit code 1! :thumbsdown:\nDetails: [changes](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952&tab=buildChangesDiv), [build log](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952)"
expected_message = u"Project :: Compile build 5535 - CL 123456 is still broken with status Exit code 1! :thumbs_down:\nDetails: [changes](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952&tab=buildChangesDiv), [build log](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952)"
self.send_and_test_stream_message('failure', self.SUBJECT, expected_message)
def test_teamcity_fixed(self) -> None:
expected_message = u"Project :: Compile build 5535 - CL 123456 has been fixed! :thumbsup:\nDetails: [changes](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952&tab=buildChangesDiv), [build log](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952)"
expected_message = u"Project :: Compile build 5535 - CL 123456 has been fixed! :thumbs_up:\nDetails: [changes](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952&tab=buildChangesDiv), [build log](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952)"
self.send_and_test_stream_message('fixed', self.SUBJECT, expected_message)
def test_teamcity_personal(self) -> None:
expected_message = u"Your personal build of Project :: Compile build 5535 - CL 123456 is broken with status Exit code 1 (new)! :thumbsdown:\nDetails: [changes](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952&tab=buildChangesDiv), [build log](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952)"
expected_message = u"Your personal build of Project :: Compile build 5535 - CL 123456 is broken with status Exit code 1 (new)! :thumbs_down:\nDetails: [changes](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952&tab=buildChangesDiv), [build log](http://teamcity/viewLog.html?buildTypeId=Project_Compile&buildId=19952)"
payload = ujson.dumps(ujson.loads(self.fixture_data(self.FIXTURE_DIR_NAME, 'personal')))
self.client_post(self.url, payload, content_type="application/json")
msg = self.get_last_message()

View File

@ -52,14 +52,14 @@ def api_teamcity_webhook(request: HttpRequest, user_profile: UserProfile,
if build_result == 'success':
if build_result_delta == 'fixed':
status = 'has been fixed! :thumbsup:'
status = 'has been fixed! :thumbs_up:'
else:
status = 'was successful! :thumbsup:'
status = 'was successful! :thumbs_up:'
elif build_result == 'failure':
if build_result_delta == 'broken':
status = 'is broken with status %s! :thumbsdown:' % (build_status,)
status = 'is broken with status %s! :thumbs_down:' % (build_status,)
else:
status = 'is still broken with status %s! :thumbsdown:' % (build_status,)
status = 'is still broken with status %s! :thumbs_down:' % (build_status,)
elif build_result == 'running':
status = 'has started.'
else:

View File

@ -18,7 +18,7 @@ class TravisHookTests(WebhookTestCase):
The subject describes the repo and Stash "project". The
content describes the commits pushed.
"""
expected_message = (u"Author: josh_mandel\nBuild status: Passed :thumbsup:\n"
expected_message = (u"Author: josh_mandel\nBuild status: Passed :thumbs_up:\n"
u"Details: [changes](https://github.com/hl7-fhir/fhir-sv"
u"n/compare/6dccb98bcfd9...6c457d366a31), [build log](ht"
u"tps://travis-ci.org/hl7-fhir/fhir-svn/builds/92495257)")
@ -43,7 +43,7 @@ class TravisHookTests(WebhookTestCase):
def test_travis_pull_requests_are_not_ignored_when_applicable(self) -> None:
self.url = "{}&ignore_pull_requests=false".format(self.build_webhook_url())
expected_message = (u"Author: josh_mandel\nBuild status: Passed :thumbsup:\n"
expected_message = (u"Author: josh_mandel\nBuild status: Passed :thumbs_up:\n"
u"Details: [changes](https://github.com/hl7-fhir/fhir-sv"
u"n/compare/6dccb98bcfd9...6c457d366a31), [build log](ht"
u"tps://travis-ci.org/hl7-fhir/fhir-svn/builds/92495257)")

View File

@ -38,9 +38,9 @@ def api_travis_webhook(request: HttpRequest, user_profile: UserProfile,
return json_success()
if message_status in GOOD_STATUSES:
emoji = ':thumbsup:'
emoji = ':thumbs_up:'
elif message_status in BAD_STATUSES:
emoji = ':thumbsdown:'
emoji = ':thumbs_down:'
else:
emoji = "(No emoji specified for status '{}'.)".format(message_status)