Skip to content

Commit ec8416a

Browse files
authored
fix: resolve unit tests issues when run with uv (#345)
* fix: resolve unit tests issues when run with uv Signed-off-by: dosi <[email protected]> * chore: update changelog Signed-off-by: dosi <[email protected]> --------- Signed-off-by: dosi <[email protected]>
1 parent ef9b3c8 commit ec8416a

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
2323
- Changed README MIT license to Apache
2424
- Documentation structure updated: contents moved from `/documentation` to `/docs`.
2525
- Switched Mirror Node endpoints used by SDK to secure ones instead of deprecated insecure endpoints (shut down on Aug 20th, see [Hedera blogpost](https://hedera.com/blog/updated-deprecation-of-the-insecure-hedera-consensus-service-hcs-mirror-node-endpoints))
26+
- Update protobuf dependency from 5.28.1 to 5.29.1
27+
- Update grpcio dependency from 1.68.1 to 1.71.2
28+
29+
### Fixed
30+
- Unit test compatibility issues when running with UV package manager
31+
- Type annotations in TokenRelationship class (kyc_status and freeze_status)
32+
- Test assertions in test_executable.py using pytest match parameter
2633

2734
### Removed
2835
- Removed the old `/documentation` folder.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ license = { file = "LICENSE" }
1313
readme = "README.md"
1414
requires-python = ">=3.10"
1515
dependencies = [
16-
"protobuf==5.28.1",
16+
"protobuf==5.29.1",
1717
"grpcio-tools==1.68.1",
18-
"grpcio==1.68.1",
18+
"grpcio==1.71.2",
1919
"cryptography==44.0.0",
2020
"python-dotenv==1.0.1",
2121
"requests==2.32.3",

src/hiero_sdk_python/tokens/token_relationship.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ class TokenRelationship:
2626
token_id (Optional[TokenId]): The ID of the token.
2727
symbol (Optional[str]): The symbol of the token.
2828
balance (Optional[int]): The balance of tokens held by the account.
29-
kyc_status (Optional[TokenFreezeStatusProto]): The KYC status of the account for this token.
30-
freeze_status (Optional[TokenFreezeStatusProto]): The freeze status of the account.
29+
kyc_status (Optional[TokenKycStatus]): The KYC status of the account for this token.
30+
freeze_status (Optional[TokenFreezeStatus]): The freeze status of the account.
3131
decimals (Optional[int]): The number of decimal places used by the token.
3232
automatic_association (Optional[bool]): If token was auto-associated to the account.
3333
"""
3434
token_id: Optional[TokenId] = None
3535
symbol: Optional[str] = None
3636
balance: Optional[int] = None
37-
kyc_status: Optional[TokenFreezeStatusProto] = None
38-
freeze_status: Optional[TokenFreezeStatusProto] = None
37+
kyc_status: Optional[TokenKycStatus] = None
38+
freeze_status: Optional[TokenFreezeStatus] = None
3939
decimals: Optional[int] = None
4040
automatic_association: Optional[bool] = None
4141

tests/unit/test_executable.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,12 @@ def test_topic_create_transaction_fails_on_nonretriable_error():
377377
.set_memo("Test with error")
378378
.set_admin_key(PrivateKey.generate().public_key())
379379
)
380-
381-
with pytest.raises(PrecheckError) as exc_info:
380+
381+
with pytest.raises(
382+
PrecheckError, match="failed precheck with status: INVALID_TRANSACTION_BODY"
383+
):
382384
tx.execute(client)
383-
384-
# Verify the error contains the expected status
385-
assert str(ResponseCode.INVALID_TRANSACTION_BODY) in str(exc_info.value)
386-
385+
387386
def test_transaction_node_switching_body_bytes():
388387
"""Test that execution switches nodes after receiving a non-retriable error."""
389388
ok_response = TransactionResponseProto(nodeTransactionPrecheckCode=ResponseCode.OK)

0 commit comments

Comments
 (0)