Skip to content

Commit

Permalink
Add pytest to the github workflow.
Browse files Browse the repository at this point in the history
I had problems with two type annotations that failed to
compile. I removed these in this change, and we can
(and should) add them back in when we have a
solution.

Signed-off-by: Richard Bair <[email protected]>
  • Loading branch information
rbair23 committed Feb 5, 2025
1 parent b4c7a70 commit d8d83ef
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
PUBLIC_KEY: ${{ steps.solo.outputs.publicKey }}
NETWORK: solo
run: |
python test.py
python test.py; uv run pytest
Empty file modified generate_proto.sh
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ lint = [
"ruff>=0.8.3",
]

[tool.pytest.ini_options]
pythonpath = ["src"]

[tool.pdm]
version = {source = "scm"}

Expand Down
2 changes: 1 addition & 1 deletion src/hiero_sdk_python/crypto/private_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class PrivateKey:
Represents a private key that can be either Ed25519 or ECDSA (secp256k1).
"""

def __init__(self, private_key: ec.EllipticCurvePrivateKey | ed25519.Ed25519PrivateKey):
def __init__(self, private_key):
"""
Initializes a PrivateKey from a cryptography PrivateKey object.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/hiero_sdk_python/crypto/public_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class PublicKey:
Represents a public key that can be either Ed25519 or ECDSA (secp256k1).
"""

def __init__(self, public_key: ec.EllipticCurvePublicKey | ed25519.Ed25519PublicKey):
def __init__(self, public_key):
"""
Initializes a PublicKey from a cryptography PublicKey object.
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from hiero_sdk_python.tokens.token_id import TokenId
from hiero_sdk_python.crypto.private_key import PrivateKey
from cryptography.hazmat.primitives import serialization
from hiero_sdk_python.hapi import basic_types_pb2
from hiero_sdk_python.hapi.services import basic_types_pb2

@pytest.fixture
def mock_account_ids():
Expand Down
4 changes: 2 additions & 2 deletions tests/test_token_mint_transaction.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import pytest
from unittest.mock import MagicMock
from hiero_sdk_python.tokens.token_mint_transaction import TokenMintTransaction
from hiero_sdk_python.hapi import basic_types_pb2, timestamp_pb2, transaction_pb2, transaction_body_pb2
from hiero_sdk_python.hapi.services import basic_types_pb2, timestamp_pb2, transaction_pb2, transaction_body_pb2
from hiero_sdk_python.transaction.transaction_id import TransactionId
from cryptography.hazmat.primitives import serialization
from hiero_sdk_python.response_code import ResponseCode
from hiero_sdk_python.hapi import token_mint_pb2
from hiero_sdk_python.hapi.services import token_mint_pb2

def generate_transaction_id(account_id_proto):
"""Generate a unique transaction ID based on the account ID and the current timestamp."""
Expand Down

0 comments on commit d8d83ef

Please sign in to comment.