Skip to content

Commit

Permalink
fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyuan committed Oct 15, 2023
1 parent 99631fd commit db1b805
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/sentry/integrations/github_enterprise/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import pytest
import responses

from sentry.integrations.mixins.repositories import RepositoryMixin
from sentry.models import Repository
from sentry.shared_integrations.exceptions import ApiError
from sentry.testutils import TestCase
from sentry.testutils.cases import TestCase

GITHUB_CODEOWNERS = {
"filepath": "CODEOWNERS",
Expand Down Expand Up @@ -87,6 +88,7 @@ def test_check_file(self):
json={"text": 200},
)

assert hasattr(self.client, "check_file")
resp = self.client.check_file(self.repo, path, version)
assert resp.status_code == 200

Expand All @@ -99,6 +101,7 @@ def test_check_no_file(self):
responses.add(method=responses.HEAD, url=url, status=404)

with pytest.raises(ApiError):
assert hasattr(self.client, "check_file")
self.client.check_file(self.repo, path, version)
assert responses.calls[1].response.status_code == 404

Expand All @@ -114,6 +117,7 @@ def test_get_stacktrace_link(self):
json={"text": 200},
)

assert isinstance(self.install, RepositoryMixin)
source_url = self.install.get_stacktrace_link(self.repo, path, "master", version)
assert (
source_url
Expand Down Expand Up @@ -142,6 +146,7 @@ def test_get_codeowner_file(self, mock_check_file):
url=url,
json={"content": base64.b64encode(GITHUB_CODEOWNERS["raw"].encode()).decode("ascii")},
)
assert isinstance(self.install, RepositoryMixin)
result = self.install.get_codeowner_file(
self.config.repository, ref=self.config.default_branch
)
Expand Down

0 comments on commit db1b805

Please sign in to comment.