Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 list_secret_scanning_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def make_result(
if alert.get("commit") is not None:
commit_info = alert["commit"]
result["first_commit_date"] = commit_info["committer"]["date"]
result["first_commit_author"] = f"{commit_info["author"]["name"]} <{commit_info["author"]["email"]}>"
result["first_commit_author"] = f"{commit_info['author']['name']} <{commit_info['author']['email']}>"

if include_locations:
# use decorated alert info, if it's there
Expand Down
11 changes: 5 additions & 6 deletions test_tls_cert_support.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_github_verify_default():

from githubapi import GitHub

gh = GitHub()
_gh = GitHub()

# Verify that session.verify is set to True by default
assert mock_session.verify == True
Expand All @@ -29,7 +29,7 @@ def test_github_verify_false():

from githubapi import GitHub

gh = GitHub(verify=False)
_gh = GitHub(verify=False)

# Verify that session.verify is set to False
assert mock_session.verify == False
Expand All @@ -45,7 +45,7 @@ def test_github_verify_cert_bundle():
from githubapi import GitHub

cert_path = "/path/to/cert.pem"
gh = GitHub(verify=cert_path)
_gh = GitHub(verify=cert_path)

# Verify that session.verify is set to the certificate path
assert mock_session.verify == cert_path
Expand All @@ -56,16 +56,15 @@ def test_github_token_required():
with patch.dict(os.environ, {}, clear=True):
with pytest.raises(ValueError, match="GITHUB_TOKEN environment variable must be set"):
from githubapi import GitHub
gh = GitHub()
_gh = GitHub()


def test_github_hostname_validation():
"""Test that GitHub class validates hostname."""
with patch.dict(os.environ, {"GITHUB_TOKEN": "test_token"}):
with pytest.raises(ValueError, match="Invalid server hostname"):
from githubapi import GitHub
gh = GitHub(hostname="invalid hostname with spaces")

_gh = GitHub(hostname="invalid hostname with spaces")

if __name__ == "__main__":
pytest.main([__file__, "-v"])
Loading