Skip to content

Commit

Permalink
Merge pull request #344 from chrisburr/test-failures
Browse files Browse the repository at this point in the history
Fix test failures I saw locally
  • Loading branch information
chrisburr authored Dec 16, 2024
2 parents 8d89fe7 + c263069 commit f2a6474
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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

0 comments on commit f2a6474

Please sign in to comment.