Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def auth_to_github(
else:
gh = github3.github.GitHub()
gh.login_as_app_installation(
gh_app_private_key_bytes, gh_app_id, gh_app_installation_id
gh_app_private_key_bytes, str(gh_app_id), gh_app_installation_id
)
Comment thread
jmeridth marked this conversation as resolved.
github_connection = gh
elif ghe and token:
Expand Down
5 changes: 3 additions & 2 deletions test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_auth_to_github_with_github_app(self, mock_login):
mock_login.return_value = MagicMock()
result = auth_to_github("", 12345, 678910, b"hello", "", False)

mock_login.assert_called_once_with(b"hello", "12345", 678910)
Comment thread
jmeridth marked this conversation as resolved.
self.assertIsInstance(result, github3.github.GitHub, False)

def test_auth_to_github_with_token(self):
Expand Down Expand Up @@ -65,9 +66,9 @@ def test_auth_to_github_with_ghe_and_ghe_app(self, mock_ghe):
mock = mock_ghe.return_value
mock.login_as_app_installation = MagicMock(return_value=True)
result = auth_to_github(
"", "123", "123", b"123", "https://github.example.com", True
"", 123, 456, b"123", "https://github.example.com", True
)
mock.login_as_app_installation.assert_called_once()
mock.login_as_app_installation.assert_called_once_with(b"123", "123", 456)
self.assertEqual(result, mock)

@patch("github3.apps.create_jwt_headers", MagicMock(return_value="gh_token"))
Expand Down
Loading