Skip to content

Commit 14579a4

Browse files
🛠️ apply pre-commit fixes
1 parent e604478 commit 14579a4

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

src/sentry/codecov/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class GitProvider(StrEnum):
2121
Codecov doesn't require this to be GitHub, but that's all that's implemented
2222
for now.
2323
"""
24+
2425
GitHub = "github"
2526

2627

tests/sentry/codecov/test_client.py

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import datetime
2+
from unittest.mock import patch
23

34
import pytest
45
import responses
5-
from unittest.mock import patch
66

77
from sentry.codecov.client import CodecovApiClient, ConfigurationError, GitProvider
88
from sentry.testutils.cases import TestCase
@@ -20,25 +20,31 @@ def setUp(self):
2020
self.test_timestamp = datetime.datetime.now(datetime.UTC)
2121
self._mock_now = patch("datetime.datetime.now", return_value=self.test_timestamp)
2222

23-
with self.options({
24-
"codecov.base-url": self.test_base_url,
25-
"codecov.api-bridge-signing-secret": self.test_secret,
26-
}):
23+
with self.options(
24+
{
25+
"codecov.base-url": self.test_base_url,
26+
"codecov.api-bridge-signing-secret": self.test_secret,
27+
}
28+
):
2729
self.codecov_client = CodecovApiClient(self.test_git_provider_user)
2830

2931
def test_raises_configuration_error_without_base_url(self):
30-
with self.options({
31-
"codecov.base-url": None,
32-
"codecov.api-bridge-signing-secret": self.test_secret,
33-
}):
32+
with self.options(
33+
{
34+
"codecov.base-url": None,
35+
"codecov.api-bridge-signing-secret": self.test_secret,
36+
}
37+
):
3438
with pytest.raises(ConfigurationError):
3539
CodecovApiClient(self.test_git_provider_user)
3640

3741
def test_raises_configuration_error_without_signing_secret(self):
38-
with self.options({
39-
"codecov.base-url": self.test_base_url,
40-
"codecov.api-bridge-signing-secret": None,
41-
}):
42+
with self.options(
43+
{
44+
"codecov.base-url": self.test_base_url,
45+
"codecov.api-bridge-signing-secret": None,
46+
}
47+
):
4248
with pytest.raises(ConfigurationError):
4349
CodecovApiClient(self.test_git_provider_user)
4450

@@ -70,7 +76,9 @@ def test_creates_valid_jwt(self):
7076
@patch("requests.get")
7177
def test_sends_get_request_with_jwt_auth_header(self, mock_get):
7278
with patch.object(self.codecov_client, "_create_jwt", return_value="test"):
73-
self.codecov_client.get("/example/endpoint", {"example-param": "foo"}, {"X_TEST_HEADER": "bar"})
79+
self.codecov_client.get(
80+
"/example/endpoint", {"example-param": "foo"}, {"X_TEST_HEADER": "bar"}
81+
)
7482
mock_get.assert_called_once_with(
7583
"http://example.com/example/endpoint",
7684
params={"example-param": "foo"},
@@ -84,7 +92,9 @@ def test_sends_get_request_with_jwt_auth_header(self, mock_get):
8492
@patch("requests.post")
8593
def test_sends_post_request_with_jwt_auth_header(self, mock_post):
8694
with patch.object(self.codecov_client, "_create_jwt", return_value="test"):
87-
self.codecov_client.post("/example/endpoint", {"example-param": "foo"}, {"X_TEST_HEADER": "bar"})
95+
self.codecov_client.post(
96+
"/example/endpoint", {"example-param": "foo"}, {"X_TEST_HEADER": "bar"}
97+
)
8898
mock_post.assert_called_once_with(
8999
"http://example.com/example/endpoint",
90100
data={"example-param": "foo"},

0 commit comments

Comments
 (0)