diff --git a/zerver/fixtures/bitbucket2/bitbucket2_commit_comment_created.json b/zerver/fixtures/bitbucket/bitbucket_v2_commit_comment_created.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_commit_comment_created.json rename to zerver/fixtures/bitbucket/bitbucket_v2_commit_comment_created.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_commit_status_changed.json b/zerver/fixtures/bitbucket/bitbucket_v2_commit_status_changed.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_commit_status_changed.json rename to zerver/fixtures/bitbucket/bitbucket_v2_commit_status_changed.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_force_push.json b/zerver/fixtures/bitbucket/bitbucket_v2_force_push.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_force_push.json rename to zerver/fixtures/bitbucket/bitbucket_v2_force_push.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_fork.json b/zerver/fixtures/bitbucket/bitbucket_v2_fork.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_fork.json rename to zerver/fixtures/bitbucket/bitbucket_v2_fork.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_issue_commented.json b/zerver/fixtures/bitbucket/bitbucket_v2_issue_commented.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_issue_commented.json rename to zerver/fixtures/bitbucket/bitbucket_v2_issue_commented.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_issue_created.json b/zerver/fixtures/bitbucket/bitbucket_v2_issue_created.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_issue_created.json rename to zerver/fixtures/bitbucket/bitbucket_v2_issue_created.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_issue_updated.json b/zerver/fixtures/bitbucket/bitbucket_v2_issue_updated.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_issue_updated.json rename to zerver/fixtures/bitbucket/bitbucket_v2_issue_updated.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_pull_request_approved_or_unapproved.json b/zerver/fixtures/bitbucket/bitbucket_v2_pull_request_approved_or_unapproved.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_pull_request_approved_or_unapproved.json rename to zerver/fixtures/bitbucket/bitbucket_v2_pull_request_approved_or_unapproved.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_pull_request_comment_action.json b/zerver/fixtures/bitbucket/bitbucket_v2_pull_request_comment_action.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_pull_request_comment_action.json rename to zerver/fixtures/bitbucket/bitbucket_v2_pull_request_comment_action.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_pull_request_created_or_updated.json b/zerver/fixtures/bitbucket/bitbucket_v2_pull_request_created_or_updated.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_pull_request_created_or_updated.json rename to zerver/fixtures/bitbucket/bitbucket_v2_pull_request_created_or_updated.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_pull_request_merged_or_rejected.json b/zerver/fixtures/bitbucket/bitbucket_v2_pull_request_merged_or_rejected.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_pull_request_merged_or_rejected.json rename to zerver/fixtures/bitbucket/bitbucket_v2_pull_request_merged_or_rejected.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_push.json b/zerver/fixtures/bitbucket/bitbucket_v2_push.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_push.json rename to zerver/fixtures/bitbucket/bitbucket_v2_push.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_push_commits_above_limit.json b/zerver/fixtures/bitbucket/bitbucket_v2_push_commits_above_limit.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_push_commits_above_limit.json rename to zerver/fixtures/bitbucket/bitbucket_v2_push_commits_above_limit.json diff --git a/zerver/fixtures/bitbucket2/bitbucket2_remove_branch.json b/zerver/fixtures/bitbucket/bitbucket_v2_remove_branch.json similarity index 100% rename from zerver/fixtures/bitbucket2/bitbucket2_remove_branch.json rename to zerver/fixtures/bitbucket/bitbucket_v2_remove_branch.json diff --git a/zerver/tests/webhooks/test_bitbucket.py b/zerver/tests/webhooks/test_bitbucket.py index e998345e51..b53d4107ea 100644 --- a/zerver/tests/webhooks/test_bitbucket.py +++ b/zerver/tests/webhooks/test_bitbucket.py @@ -5,7 +5,7 @@ from zerver.lib.test_helpers import WebhookTestCase class Bitbucket2HookTests(WebhookTestCase): STREAM_NAME = 'bitbucket2' URL_TEMPLATE = "/api/v1/external/bitbucket2?stream={stream}&api_key={api_key}" - FIXTURE_DIR_NAME = 'bitbucket2' + FIXTURE_DIR_NAME = 'bitbucket' EXPECTED_SUBJECT = u"Repository name" EXPECTED_SUBJECT_BRANCH_EVENTS = u"Repository name / master" @@ -13,7 +13,7 @@ class Bitbucket2HookTests(WebhookTestCase): # type: () -> None commit_info = u'* [84b96ad](https://bitbucket.org/kolaszek/repository-name/commits/84b96adc644a30fd6465b3d196369d880762afed): first commit' expected_message = u"kolaszek [pushed](https://bitbucket.org/kolaszek/repository-name/branch/master) to branch master\n\n{}".format(commit_info) - self.send_and_test_stream_message('push', self.EXPECTED_SUBJECT_BRANCH_EVENTS, expected_message) + self.send_and_test_stream_message('v2_push', self.EXPECTED_SUBJECT_BRANCH_EVENTS, expected_message) def test_bitbucket2_on_push_commits_above_limit_event(self): # type: () -> None @@ -23,47 +23,47 @@ class Bitbucket2HookTests(WebhookTestCase): (commit_info * 10), number_of_hidden_commits ) - self.send_and_test_stream_message('push_commits_above_limit', self.EXPECTED_SUBJECT_BRANCH_EVENTS, expected_message) + self.send_and_test_stream_message('v2_push_commits_above_limit', self.EXPECTED_SUBJECT_BRANCH_EVENTS, expected_message) def test_bitbucket2_on_force_push_event(self): # type: () -> None expected_message = u"kolaszek [force pushed](https://bitbucket.org/kolaszek/repository-name/branch/master) to branch master. Head is now 25f93d22b719e2d678a7ad5ee0ef0d1fcdf39c12" - self.send_and_test_stream_message('force_push', self.EXPECTED_SUBJECT_BRANCH_EVENTS, expected_message) + self.send_and_test_stream_message('v2_force_push', self.EXPECTED_SUBJECT_BRANCH_EVENTS, expected_message) def test_bitbucket2_on_remove_branch_event(self): # type: () -> None expected_message = u"kolaszek deleted branch master" - self.send_and_test_stream_message('remove_branch', self.EXPECTED_SUBJECT_BRANCH_EVENTS, expected_message) + self.send_and_test_stream_message('v2_remove_branch', self.EXPECTED_SUBJECT_BRANCH_EVENTS, expected_message) def test_bitbucket2_on_fork_event(self): # type: () -> None expected_message = u"User Tomasz(login: kolaszek) forked the repository into [kolaszek/repository-name2](https://bitbucket.org/kolaszek/repository-name2)." - self.send_and_test_stream_message('fork', self.EXPECTED_SUBJECT, expected_message) + self.send_and_test_stream_message('v2_fork', self.EXPECTED_SUBJECT, expected_message) def test_bitbucket2_on_commit_comment_created_event(self): # type: () -> None expected_message = u"User Tomasz(login: kolaszek) added [comment](https://bitbucket.org/kolaszek/repository-name/commits/32c4ea19aa3af10acd08e419e2c354941a365d74#comment-3354963) to commit." - self.send_and_test_stream_message('commit_comment_created', self.EXPECTED_SUBJECT, expected_message) + self.send_and_test_stream_message('v2_commit_comment_created', self.EXPECTED_SUBJECT, expected_message) def test_bitbucket2_on_commit_status_changed_event(self): # type: () -> None expected_message = u"[System mybuildtool](https://my-build-tool.com/builds/MY-PROJECT/BUILD-777) changed status of https://bitbucket.org/kolaszek/repository-name/9fec847784abb10b2fa567ee63b85bd238955d0e to SUCCESSFUL." - self.send_and_test_stream_message('commit_status_changed', self.EXPECTED_SUBJECT, expected_message) + self.send_and_test_stream_message('v2_commit_status_changed', self.EXPECTED_SUBJECT, expected_message) def test_bitbucket2_on_issue_created_event(self): # type: () -> None expected_message = u"User Tomasz(login: kolaszek) created [an issue](https://bitbucket.org/kolaszek/repository-name/issues/2/bug)" - self.send_and_test_stream_message('issue_created', self.EXPECTED_SUBJECT, expected_message) + self.send_and_test_stream_message('v2_issue_created', self.EXPECTED_SUBJECT, expected_message) def test_bitbucket2_on_issue_updated_event(self): # type: () -> None expected_message = u"User Tomasz(login: kolaszek) updated [an issue](https://bitbucket.org/kolaszek/repository-name/issues/2/bug)" - self.send_and_test_stream_message('issue_updated', self.EXPECTED_SUBJECT, expected_message) + self.send_and_test_stream_message('v2_issue_updated', self.EXPECTED_SUBJECT, expected_message) def test_bitbucket2_on_issue_commented_event(self): # type: () -> None expected_message = u"User Tomasz(login: kolaszek) commented [an issue](https://bitbucket.org/kolaszek/repository-name/issues/2/bug)" - self.send_and_test_stream_message('issue_commented', self.EXPECTED_SUBJECT, expected_message) + self.send_and_test_stream_message('v2_issue_commented', self.EXPECTED_SUBJECT, expected_message) def test_bitbucket2_on_pull_request_created_event(self): # type: () -> None @@ -71,7 +71,7 @@ class Bitbucket2HookTests(WebhookTestCase): kwargs = { "HTTP_X_EVENT_KEY": 'pullrequest:created' } - self.send_and_test_stream_message('pull_request_created_or_updated', self.EXPECTED_SUBJECT, expected_message, **kwargs) + self.send_and_test_stream_message('v2_pull_request_created_or_updated', self.EXPECTED_SUBJECT, expected_message, **kwargs) def test_bitbucket2_on_pull_request_updated_event(self): # type: () -> None @@ -79,7 +79,7 @@ class Bitbucket2HookTests(WebhookTestCase): kwargs = { "HTTP_X_EVENT_KEY": 'pullrequest:updated' } - self.send_and_test_stream_message('pull_request_created_or_updated', self.EXPECTED_SUBJECT, expected_message, **kwargs) + self.send_and_test_stream_message('v2_pull_request_created_or_updated', self.EXPECTED_SUBJECT, expected_message, **kwargs) def test_bitbucket2_on_pull_request_approved_event(self): # type: () -> None @@ -87,7 +87,7 @@ class Bitbucket2HookTests(WebhookTestCase): kwargs = { "HTTP_X_EVENT_KEY": 'pullrequest:approved' } - self.send_and_test_stream_message('pull_request_approved_or_unapproved', self.EXPECTED_SUBJECT, expected_message, **kwargs) + self.send_and_test_stream_message('v2_pull_request_approved_or_unapproved', self.EXPECTED_SUBJECT, expected_message, **kwargs) def test_bitbucket2_on_pull_request_unapproved_event(self): # type: () -> None @@ -95,7 +95,7 @@ class Bitbucket2HookTests(WebhookTestCase): kwargs = { "HTTP_X_EVENT_KEY": 'pullrequest:unapproved' } - self.send_and_test_stream_message('pull_request_approved_or_unapproved', self.EXPECTED_SUBJECT, expected_message, **kwargs) + self.send_and_test_stream_message('v2_pull_request_approved_or_unapproved', self.EXPECTED_SUBJECT, expected_message, **kwargs) def test_bitbucket2_on_pull_request_declined_event(self): # type: () -> None @@ -103,7 +103,7 @@ class Bitbucket2HookTests(WebhookTestCase): kwargs = { "HTTP_X_EVENT_KEY": 'pullrequest:rejected' } - self.send_and_test_stream_message('pull_request_merged_or_rejected', self.EXPECTED_SUBJECT, expected_message, **kwargs) + self.send_and_test_stream_message('v2_pull_request_merged_or_rejected', self.EXPECTED_SUBJECT, expected_message, **kwargs) def test_bitbucket2_on_pull_request_merged_event(self): # type: () -> None @@ -111,7 +111,7 @@ class Bitbucket2HookTests(WebhookTestCase): kwargs = { "HTTP_X_EVENT_KEY": 'pullrequest:merged' } - self.send_and_test_stream_message('pull_request_merged_or_rejected', self.EXPECTED_SUBJECT, expected_message, **kwargs) + self.send_and_test_stream_message('v2_pull_request_merged_or_rejected', self.EXPECTED_SUBJECT, expected_message, **kwargs) def test_bitbucket2_on_pull_request_comment_created_event(self): # type: () -> None @@ -119,7 +119,7 @@ class Bitbucket2HookTests(WebhookTestCase): kwargs = { "HTTP_X_EVENT_KEY": 'pullrequest:comment_created' } - self.send_and_test_stream_message('pull_request_comment_action', self.EXPECTED_SUBJECT, expected_message, **kwargs) + self.send_and_test_stream_message('v2_pull_request_comment_action', self.EXPECTED_SUBJECT, expected_message, **kwargs) def test_bitbucket2_on_pull_request_comment_updated_event(self): # type: () -> None @@ -127,7 +127,7 @@ class Bitbucket2HookTests(WebhookTestCase): kwargs = { "HTTP_X_EVENT_KEY": 'pullrequest:comment_updated' } - self.send_and_test_stream_message('pull_request_comment_action', self.EXPECTED_SUBJECT, expected_message, **kwargs) + self.send_and_test_stream_message('v2_pull_request_comment_action', self.EXPECTED_SUBJECT, expected_message, **kwargs) def test_bitbucket2_on_pull_request_comment_deleted_event(self): # type: () -> None @@ -135,4 +135,4 @@ class Bitbucket2HookTests(WebhookTestCase): kwargs = { "HTTP_X_EVENT_KEY": 'pullrequest:comment_deleted' } - self.send_and_test_stream_message('pull_request_comment_action', self.EXPECTED_SUBJECT, expected_message, **kwargs) + self.send_and_test_stream_message('v2_pull_request_comment_action', self.EXPECTED_SUBJECT, expected_message, **kwargs)