Skip to content

Commit

Permalink
use cast()
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyuan committed Oct 15, 2023
1 parent 2b0a9b2 commit f6e5b51
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/sentry/integrations/github_enterprise/test_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import base64
from typing import cast
from unittest import mock

import pytest
Expand Down Expand Up @@ -66,7 +67,10 @@ def setUp(self):
external_id=123,
integration_id=integration.id,
)
self.install = integration.get_installation(organization_id=self.organization.id)
self.install = cast(
GitHubEnterpriseIntegration,
integration.get_installation(organization_id=self.organization.id),
)
assert isinstance(self.install, GitHubEnterpriseIntegration)
self.gh_client = self.install.get_client()
responses.add(
Expand Down Expand Up @@ -116,7 +120,6 @@ def test_get_stacktrace_link(self):
json={"text": 200},
)

assert isinstance(self.install, GitHubEnterpriseIntegration)
source_url = self.install.get_stacktrace_link(self.repo, path, "master", version)
assert (
source_url
Expand Down Expand Up @@ -145,7 +148,6 @@ 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, GitHubEnterpriseIntegration)
result = self.install.get_codeowner_file(
self.config.repository, ref=self.config.default_branch
)
Expand Down

0 comments on commit f6e5b51

Please sign in to comment.