Skip to content

Commit f1f4651

Browse files
committed
fix: tests
1 parent 19431d0 commit f1f4651

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/sentry/integrations/github/tasks/test_pr_comment.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def test_comment_workflow_updates_comment(self, mock_metrics, mock_issues):
446446
@patch(
447447
"sentry.integrations.github.integration.GitHubPRCommentWorkflow.get_top_5_issues_by_count"
448448
)
449-
@patch("sentry.integrations.source_code_management.commit_context.metrics")
449+
@patch("sentry.integrations.source_code_management.tasks.metrics")
450450
@patch("sentry.integrations.github.integration.metrics")
451451
@responses.activate
452452
def test_comment_workflow_api_error(self, mock_integration_metrics, mock_metrics, mock_issues):
@@ -514,7 +514,7 @@ def test_comment_workflow_api_error(self, mock_integration_metrics, mock_metrics
514514
@patch(
515515
"sentry.integrations.github.integration.GitHubPRCommentWorkflow.get_top_5_issues_by_count"
516516
)
517-
@patch("sentry.integrations.source_code_management.commit_context.metrics")
517+
@patch("sentry.integrations.source_code_management.tasks.metrics")
518518
@patch("sentry.models.Organization.objects")
519519
def test_comment_workflow_missing_org(
520520
self, mock_repository, mock_metrics, mock_issues, mock_issue_query
@@ -529,7 +529,7 @@ def test_comment_workflow_missing_org(
529529
assert not mock_issues.called
530530
assert cache.get(self.cache_key) is None
531531
mock_metrics.incr.assert_called_with(
532-
"github.pr_comment.error", tags={"type": "missing_org"}
532+
"source_code_management.pr_comment.error", tags={"type": "missing_org"}
533533
)
534534

535535
@patch(
@@ -547,7 +547,7 @@ def test_comment_workflow_missing_org_option(self, mock_issues):
547547
"sentry.integrations.github.integration.GitHubPRCommentWorkflow.get_top_5_issues_by_count"
548548
)
549549
@patch("sentry.models.Project.objects.get_from_cache")
550-
@patch("sentry.integrations.source_code_management.commit_context.metrics")
550+
@patch("sentry.integrations.source_code_management.tasks.metrics")
551551
def test_comment_workflow_missing_project(self, mock_metrics, mock_project, mock_issues):
552552
# Project.DoesNotExist should trigger the cache to release the key
553553
cache.set(self.cache_key, True, timedelta(minutes=5).total_seconds())
@@ -567,7 +567,7 @@ def test_comment_workflow_missing_project(self, mock_metrics, mock_project, mock
567567
)
568568
@patch("sentry.models.Repository.objects")
569569
@patch("sentry.integrations.github.integration.GitHubPRCommentWorkflow.get_comment_body")
570-
@patch("sentry.integrations.source_code_management.commit_context.metrics")
570+
@patch("sentry.integrations.source_code_management.tasks.metrics")
571571
def test_comment_workflow_missing_repo(
572572
self, mock_metrics, mock_get_comment_body, mock_repository, mock_issues
573573
):
@@ -585,14 +585,14 @@ def test_comment_workflow_missing_repo(
585585
assert not mock_get_comment_body.called
586586
assert cache.get(self.cache_key) is None
587587
mock_metrics.incr.assert_called_with(
588-
"github.pr_comment.error", tags={"type": "missing_repo"}
588+
"source_code_management.pr_comment.error", tags={"type": "missing_repo"}
589589
)
590590

591591
@patch(
592592
"sentry.integrations.github.integration.GitHubPRCommentWorkflow.get_top_5_issues_by_count"
593593
)
594594
@patch("sentry.integrations.github.integration.GitHubPRCommentWorkflow.get_comment_body")
595-
@patch("sentry.integrations.source_code_management.commit_context.metrics")
595+
@patch("sentry.integrations.source_code_management.tasks.metrics")
596596
def test_comment_workflow_missing_integration(
597597
self, mock_metrics, mock_get_comment_body, mock_issues
598598
):
@@ -613,7 +613,7 @@ def test_comment_workflow_missing_integration(
613613
assert not mock_get_comment_body.called
614614
assert cache.get(self.cache_key) is None
615615
mock_metrics.incr.assert_called_with(
616-
"github.pr_comment.error", tags={"type": "missing_integration"}
616+
"source_code_management.pr_comment.error", tags={"type": "missing_integration"}
617617
)
618618

619619
@patch(

0 commit comments

Comments
 (0)