Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test failures I saw locally #344

Merged
merged 1 commit into from
Dec 16, 2024
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
10 changes: 9 additions & 1 deletion diracx-core/tests/test_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@

def compare_keys(key1, key2):
"""Compare two keys by checking their public keys."""
assert key1.public_key() == key2.public_key()
key1_public = key1.public_key().public_bytes(
encoding=serialization.Encoding.PEM,
format=serialization.PublicFormat.SubjectPublicKeyInfo,
)
key2_public = key2.public_key().public_bytes(
encoding=serialization.Encoding.PEM,
format=serialization.PublicFormat.SubjectPublicKeyInfo,
)
assert key1_public == key2_public


def test_token_signing_key(tmp_path):
Expand Down
2 changes: 1 addition & 1 deletion diracx-core/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_read_credentials_missing_file(tmp_path):
def test_write_credentials_unavailable_path():
"""Test that write_credentials raises error when it can't create path."""
wrong_path = Path("/wrong/path/file.txt")
with pytest.raises(PermissionError):
with pytest.raises((PermissionError, OSError)):
write_credentials(TokenResponse(**TOKEN_RESPONSE_DICT), location=wrong_path)


Expand Down
Loading