Skip to content

Commit

Permalink
fix: pass args to send_reports_result_request (#545)
Browse files Browse the repository at this point in the history
* fix: pass args to send_reports_result_request

* chore: lint

* test: fix tests

* fix: typing and tests

* fix: typing

* chore: make lint

* fix: simple import typing fix
  • Loading branch information
joseph-sentry authored Nov 13, 2024
1 parent 2935526 commit 01046d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions codecov_cli/services/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import time
import typing

import requests

from codecov_cli.helpers import request
from codecov_cli.helpers.config import CODECOV_API_URL, CODECOV_INGEST_URL
from codecov_cli.helpers.encoder import encode_slug
Expand All @@ -26,7 +28,7 @@ def create_report_logic(
enterprise_url: str,
pull_request_number: int,
fail_on_error: bool = False,
args: dict = None,
args: typing.Union[dict, None] = None,
):
encoded_slug = encode_slug(slug)
sending_result = send_create_report_request(
Expand Down Expand Up @@ -71,7 +73,7 @@ def create_report_results_logic(
token: typing.Optional[str],
enterprise_url: str,
fail_on_error: bool = False,
args: dict = None,
args: typing.Union[dict, None] = None,
):
encoded_slug = encode_slug(slug)
sending_result = send_reports_result_request(
Expand All @@ -81,6 +83,7 @@ def create_report_results_logic(
service=service,
token=token,
enterprise_url=enterprise_url,
args=args,
)

log_warnings_and_errors_if_any(
Expand Down
2 changes: 2 additions & 0 deletions tests/services/report/test_report_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def test_report_results_command_with_warnings(mocker):

assert res == mock_send_reports_result_request.return_value
mock_send_reports_result_request.assert_called_with(
args=None,
commit_sha="commit_sha",
report_code="code",
service="service",
Expand Down Expand Up @@ -85,6 +86,7 @@ def test_report_results_command_with_error(mocker):
]
assert res == mock_send_reports_result_request.return_value
mock_send_reports_result_request.assert_called_with(
args=None,
commit_sha="commit_sha",
report_code="code",
service="service",
Expand Down

0 comments on commit 01046d1

Please sign in to comment.