From 9ae0cc0a18097d4acc73c7fd560d51e08723c96d Mon Sep 17 00:00:00 2001 From: Alena Volkova Date: Wed, 14 Mar 2018 14:02:39 -0400 Subject: [PATCH] webhooks/front: Remove numbers from fixture names. --- .../{15_comment.json => comment.json} | 0 ...chived.json => conversation_archived.json} | 0 ...signed.json => conversation_assigned.json} | 0 ...on => conversation_assigned_outbound.json} | 0 ....json => conversation_assigned_reply.json} | 0 ...deleted.json => conversation_deleted.json} | 0 ...opened.json => conversation_reopened.json} | 0 ...stored.json => conversation_restored.json} | 0 ...n_tagged.json => conversation_tagged.json} | 0 ...gned.json => conversation_unassigned.json} | 0 ...tagged.json => conversation_untagged.json} | 0 ...ound_message.json => inbound_message.json} | 0 .../{14_mention.json => mention.json} | 0 .../{8_mention_all.json => mention_all.json} | 0 ...und_message.json => outbound_message.json} | 0 ...utbound_reply.json => outbound_reply.json} | 0 zerver/webhooks/front/tests.py | 34 +++++++++---------- 17 files changed, 17 insertions(+), 17 deletions(-) rename zerver/webhooks/front/fixtures/{15_comment.json => comment.json} (100%) rename zerver/webhooks/front/fixtures/{3_conversation_archived.json => conversation_archived.json} (100%) rename zerver/webhooks/front/fixtures/{16_conversation_assigned.json => conversation_assigned.json} (100%) rename zerver/webhooks/front/fixtures/{1_conversation_assigned_outbound.json => conversation_assigned_outbound.json} (100%) rename zerver/webhooks/front/fixtures/{11_conversation_assigned_reply.json => conversation_assigned_reply.json} (100%) rename zerver/webhooks/front/fixtures/{5_conversation_deleted.json => conversation_deleted.json} (100%) rename zerver/webhooks/front/fixtures/{4_conversation_reopened.json => conversation_reopened.json} (100%) rename zerver/webhooks/front/fixtures/{6_conversation_restored.json => conversation_restored.json} (100%) rename zerver/webhooks/front/fixtures/{10_conversation_tagged.json => conversation_tagged.json} (100%) rename zerver/webhooks/front/fixtures/{7_conversation_unassigned.json => conversation_unassigned.json} (100%) rename zerver/webhooks/front/fixtures/{13_conversation_untagged.json => conversation_untagged.json} (100%) rename zerver/webhooks/front/fixtures/{9_inbound_message.json => inbound_message.json} (100%) rename zerver/webhooks/front/fixtures/{14_mention.json => mention.json} (100%) rename zerver/webhooks/front/fixtures/{8_mention_all.json => mention_all.json} (100%) rename zerver/webhooks/front/fixtures/{2_outbound_message.json => outbound_message.json} (100%) rename zerver/webhooks/front/fixtures/{12_outbound_reply.json => outbound_reply.json} (100%) diff --git a/zerver/webhooks/front/fixtures/15_comment.json b/zerver/webhooks/front/fixtures/comment.json similarity index 100% rename from zerver/webhooks/front/fixtures/15_comment.json rename to zerver/webhooks/front/fixtures/comment.json diff --git a/zerver/webhooks/front/fixtures/3_conversation_archived.json b/zerver/webhooks/front/fixtures/conversation_archived.json similarity index 100% rename from zerver/webhooks/front/fixtures/3_conversation_archived.json rename to zerver/webhooks/front/fixtures/conversation_archived.json diff --git a/zerver/webhooks/front/fixtures/16_conversation_assigned.json b/zerver/webhooks/front/fixtures/conversation_assigned.json similarity index 100% rename from zerver/webhooks/front/fixtures/16_conversation_assigned.json rename to zerver/webhooks/front/fixtures/conversation_assigned.json diff --git a/zerver/webhooks/front/fixtures/1_conversation_assigned_outbound.json b/zerver/webhooks/front/fixtures/conversation_assigned_outbound.json similarity index 100% rename from zerver/webhooks/front/fixtures/1_conversation_assigned_outbound.json rename to zerver/webhooks/front/fixtures/conversation_assigned_outbound.json diff --git a/zerver/webhooks/front/fixtures/11_conversation_assigned_reply.json b/zerver/webhooks/front/fixtures/conversation_assigned_reply.json similarity index 100% rename from zerver/webhooks/front/fixtures/11_conversation_assigned_reply.json rename to zerver/webhooks/front/fixtures/conversation_assigned_reply.json diff --git a/zerver/webhooks/front/fixtures/5_conversation_deleted.json b/zerver/webhooks/front/fixtures/conversation_deleted.json similarity index 100% rename from zerver/webhooks/front/fixtures/5_conversation_deleted.json rename to zerver/webhooks/front/fixtures/conversation_deleted.json diff --git a/zerver/webhooks/front/fixtures/4_conversation_reopened.json b/zerver/webhooks/front/fixtures/conversation_reopened.json similarity index 100% rename from zerver/webhooks/front/fixtures/4_conversation_reopened.json rename to zerver/webhooks/front/fixtures/conversation_reopened.json diff --git a/zerver/webhooks/front/fixtures/6_conversation_restored.json b/zerver/webhooks/front/fixtures/conversation_restored.json similarity index 100% rename from zerver/webhooks/front/fixtures/6_conversation_restored.json rename to zerver/webhooks/front/fixtures/conversation_restored.json diff --git a/zerver/webhooks/front/fixtures/10_conversation_tagged.json b/zerver/webhooks/front/fixtures/conversation_tagged.json similarity index 100% rename from zerver/webhooks/front/fixtures/10_conversation_tagged.json rename to zerver/webhooks/front/fixtures/conversation_tagged.json diff --git a/zerver/webhooks/front/fixtures/7_conversation_unassigned.json b/zerver/webhooks/front/fixtures/conversation_unassigned.json similarity index 100% rename from zerver/webhooks/front/fixtures/7_conversation_unassigned.json rename to zerver/webhooks/front/fixtures/conversation_unassigned.json diff --git a/zerver/webhooks/front/fixtures/13_conversation_untagged.json b/zerver/webhooks/front/fixtures/conversation_untagged.json similarity index 100% rename from zerver/webhooks/front/fixtures/13_conversation_untagged.json rename to zerver/webhooks/front/fixtures/conversation_untagged.json diff --git a/zerver/webhooks/front/fixtures/9_inbound_message.json b/zerver/webhooks/front/fixtures/inbound_message.json similarity index 100% rename from zerver/webhooks/front/fixtures/9_inbound_message.json rename to zerver/webhooks/front/fixtures/inbound_message.json diff --git a/zerver/webhooks/front/fixtures/14_mention.json b/zerver/webhooks/front/fixtures/mention.json similarity index 100% rename from zerver/webhooks/front/fixtures/14_mention.json rename to zerver/webhooks/front/fixtures/mention.json diff --git a/zerver/webhooks/front/fixtures/8_mention_all.json b/zerver/webhooks/front/fixtures/mention_all.json similarity index 100% rename from zerver/webhooks/front/fixtures/8_mention_all.json rename to zerver/webhooks/front/fixtures/mention_all.json diff --git a/zerver/webhooks/front/fixtures/2_outbound_message.json b/zerver/webhooks/front/fixtures/outbound_message.json similarity index 100% rename from zerver/webhooks/front/fixtures/2_outbound_message.json rename to zerver/webhooks/front/fixtures/outbound_message.json diff --git a/zerver/webhooks/front/fixtures/12_outbound_reply.json b/zerver/webhooks/front/fixtures/outbound_reply.json similarity index 100% rename from zerver/webhooks/front/fixtures/12_outbound_reply.json rename to zerver/webhooks/front/fixtures/outbound_reply.json diff --git a/zerver/webhooks/front/tests.py b/zerver/webhooks/front/tests.py index 3db059a8a2..f364612739 100644 --- a/zerver/webhooks/front/tests.py +++ b/zerver/webhooks/front/tests.py @@ -15,7 +15,7 @@ class FrontHookTests(WebhookTestCase): expected_subject = 'cnv_keo696' expected_message = "**Leela Turanga** assigned themselves." - self.send_and_test_stream_message('1_conversation_assigned_outbound', + self.send_and_test_stream_message('conversation_assigned_outbound', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -27,7 +27,7 @@ class FrontHookTests(WebhookTestCase): "to **calculon@momsbot.com**.\n" \ "```quote\n*Subject*: Your next delivery is on Epsilon 96Z\n```" - self.send_and_test_stream_message('2_outbound_message', + self.send_and_test_stream_message('outbound_message', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -36,7 +36,7 @@ class FrontHookTests(WebhookTestCase): expected_subject = 'cnv_keo696' expected_message = "Archived by **Leela Turanga**." - self.send_and_test_stream_message('3_conversation_archived', + self.send_and_test_stream_message('conversation_archived', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -45,7 +45,7 @@ class FrontHookTests(WebhookTestCase): expected_subject = 'cnv_keo696' expected_message = "Reopened by **Leela Turanga**." - self.send_and_test_stream_message('4_conversation_reopened', + self.send_and_test_stream_message('conversation_reopened', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -54,7 +54,7 @@ class FrontHookTests(WebhookTestCase): expected_subject = 'cnv_keo696' expected_message = "Deleted by **Leela Turanga**." - self.send_and_test_stream_message('5_conversation_deleted', + self.send_and_test_stream_message('conversation_deleted', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -63,7 +63,7 @@ class FrontHookTests(WebhookTestCase): expected_subject = 'cnv_keo696' expected_message = "Restored by **Leela Turanga**." - self.send_and_test_stream_message('6_conversation_restored', + self.send_and_test_stream_message('conversation_restored', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -72,7 +72,7 @@ class FrontHookTests(WebhookTestCase): expected_subject = 'cnv_keo696' expected_message = "Unassined by **Leela Turanga**." - self.send_and_test_stream_message('7_conversation_unassigned', + self.send_and_test_stream_message('conversation_unassigned', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -82,7 +82,7 @@ class FrontHookTests(WebhookTestCase): expected_message = "**Leela Turanga** left a comment:\n" \ "```quote\n@all Could someone else take this?\n```" - self.send_and_test_stream_message('8_mention_all', + self.send_and_test_stream_message('mention_all', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -96,7 +96,7 @@ class FrontHookTests(WebhookTestCase): "to **support@planet-express.com**.\n" \ "```quote\n*Subject*: Being a robot is great, but...\n```" - self.send_and_test_stream_message('9_inbound_message', + self.send_and_test_stream_message('inbound_message', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -105,7 +105,7 @@ class FrontHookTests(WebhookTestCase): expected_subject = 'cnv_keocka' expected_message = "**Leela Turanga** added tag **Urgent**." - self.send_and_test_stream_message('10_conversation_tagged', + self.send_and_test_stream_message('conversation_tagged', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -115,7 +115,7 @@ class FrontHookTests(WebhookTestCase): expected_subject = 'cnv_keocka' expected_message = "**Leela Turanga** assigned themselves." - self.send_and_test_stream_message('11_conversation_assigned_reply', + self.send_and_test_stream_message('conversation_assigned_reply', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -126,7 +126,7 @@ class FrontHookTests(WebhookTestCase): "from **support@planet-express.com** " \ "to **calculon@momsbot.com**." - self.send_and_test_stream_message('12_outbound_reply', + self.send_and_test_stream_message('outbound_reply', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -135,7 +135,7 @@ class FrontHookTests(WebhookTestCase): expected_subject = 'cnv_keocka' expected_message = "**Leela Turanga** removed tag **Urgent**." - self.send_and_test_stream_message('13_conversation_untagged', + self.send_and_test_stream_message('conversation_untagged', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -145,7 +145,7 @@ class FrontHookTests(WebhookTestCase): expected_message = "**Leela Turanga** left a comment:\n" \ "```quote\n@bender Could you take it from here?\n```" - self.send_and_test_stream_message('14_mention', + self.send_and_test_stream_message('mention', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -155,7 +155,7 @@ class FrontHookTests(WebhookTestCase): expected_message = "**Bender Rodriguez** left a comment:\n" \ "```quote\nSure.\n```" - self.send_and_test_stream_message('15_comment', + self.send_and_test_stream_message('comment', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") @@ -165,13 +165,13 @@ class FrontHookTests(WebhookTestCase): expected_subject = 'cnv_keocka' expected_message = "**Leela Turanga** assigned **Bender Rodriguez**." - self.send_and_test_stream_message('16_conversation_assigned', + self.send_and_test_stream_message('conversation_assigned', expected_subject, expected_message, content_type="application/x-www-form-urlencoded") def test_unknown_webhook_request(self) -> None: - payload = self.get_body('16_conversation_assigned') + payload = self.get_body('conversation_assigned') payload_json = ujson.loads(payload) payload_json['type'] = 'qwerty' result = self.client_post(self.url, ujson.dumps(payload_json),