Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 4d2c20e

Browse files
committed
reports: Make mock metrics name consistent
1 parent eaf9a41 commit 4d2c20e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

upload/tests/views/test_reports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_reports_get_not_allowed(client, mocker, db):
4141

4242
def test_reports_post(client, db, mocker):
4343
mocked_call = mocker.patch.object(TaskService, "preprocess_upload")
44-
mock_metrics = mocker.patch("upload.metrics.API_UPLOAD_COUNTER.labels")
44+
mock_prometheus_metrics = mocker.patch("upload.metrics.API_UPLOAD_COUNTER.labels")
4545
repository = RepositoryFactory(
4646
name="the_repo", author__username="codecov", author__service="github"
4747
)
@@ -65,7 +65,7 @@ def test_reports_post(client, db, mocker):
6565
commit_id=commit.id, code="code1", report_type=CommitReport.ReportType.COVERAGE
6666
).exists()
6767
mocked_call.assert_called_with(repository.repoid, commit.commitid, "code1")
68-
mock_metrics.assert_called_with(
68+
mock_prometheus_metrics.assert_called_with(
6969
**{
7070
"agent": "cli",
7171
"version": "0.4.7",

upload/views/reports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def perform_create(self, serializer):
137137
is_shelter_request=self.is_shelter_request(),
138138
position="end",
139139
),
140-
).incr()
140+
).inc()
141141
return instance
142142

143143
def get_object(self):

0 commit comments

Comments
 (0)