From 15eaafa50fb537109072f549f0f5d0c1c2e49c10 Mon Sep 17 00:00:00 2001 From: Josh Mandel Date: Tue, 6 Feb 2018 20:26:08 -0600 Subject: [PATCH] Add underscores to thumbs_up and thumbs_down emoji --- zerver/webhooks/solano/tests.py | 4 ++-- zerver/webhooks/solano/view.py | 4 ++-- zerver/webhooks/teamcity/tests.py | 10 +++++----- zerver/webhooks/teamcity/view.py | 8 ++++---- zerver/webhooks/travis/tests.py | 4 ++-- zerver/webhooks/travis/view.py | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/zerver/webhooks/solano/tests.py b/zerver/webhooks/solano/tests.py index 472b732663..51fc9feacd 100644 --- a/zerver/webhooks/solano/tests.py +++ b/zerver/webhooks/solano/tests.py @@ -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, diff --git a/zerver/webhooks/solano/view.py b/zerver/webhooks/solano/view.py index a4bf29d852..a0924e7b3f 100644 --- a/zerver/webhooks/solano/view.py +++ b/zerver/webhooks/solano/view.py @@ -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: diff --git a/zerver/webhooks/teamcity/tests.py b/zerver/webhooks/teamcity/tests.py index 93b6076f56..932fdef883 100644 --- a/zerver/webhooks/teamcity/tests.py +++ b/zerver/webhooks/teamcity/tests.py @@ -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() diff --git a/zerver/webhooks/teamcity/view.py b/zerver/webhooks/teamcity/view.py index 50c16d970f..6fa93e95bf 100644 --- a/zerver/webhooks/teamcity/view.py +++ b/zerver/webhooks/teamcity/view.py @@ -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: diff --git a/zerver/webhooks/travis/tests.py b/zerver/webhooks/travis/tests.py index cbba2fe71c..d6aba9c18a 100644 --- a/zerver/webhooks/travis/tests.py +++ b/zerver/webhooks/travis/tests.py @@ -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)") diff --git a/zerver/webhooks/travis/view.py b/zerver/webhooks/travis/view.py index 21dd084905..6ee4a41b17 100644 --- a/zerver/webhooks/travis/view.py +++ b/zerver/webhooks/travis/view.py @@ -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)