Skip to content
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
## [Unreleased]

### Added
- Added unit tests for `SubscriptionHandle` class covering cancellation state, thread management, and join operations.
- Modularized `transfer_transaction_fungible` example by introducing `account_balance_query()` & `transfer_transaction()`.Renamed `transfer_tokens()` → `main()`
- Phase 2 of the inactivity-unassign bot:Automatically detects stale open pull requests (no commit activity for 21+ days), comments with a helpful InactivityBot message, closes the stale PR, and unassigns the contributor from the linked issue.
- Added **str**() to CustomFixedFee and updated examples and tests accordingly.
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,5 @@ Thank you for contributing to the Hiero Python SDK! 🎉
- **Need help or want to connect?** Join our community on Discord! See the **[Discord Joining Guide](docs/discord.md)** for detailed steps on how to join the LFDT server
- **Quick Links:**
- Join the main [Linux Foundation Decentralized Trust (LFDT) Discord Server](https://discord.gg/hyperledger).
- Go directly to the [#hiero-python-sdk channel](https://discord.com/channels/905194001349627914/1336494517544681563)
- Go directly to the [#hiero-python-sdk channel](https://discord.com/channels/905194001349627914/1336494517544681563)

28 changes: 28 additions & 0 deletions tests/unit/test_subscription_handle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from unittest.mock import Mock

from hiero_sdk_python.utils.subscription_handle import SubscriptionHandle


def test_not_cancelled_by_default():
handle = SubscriptionHandle()
assert not handle.is_cancelled()


def test_cancel_marks_as_cancelled():
handle = SubscriptionHandle()
handle.cancel()
assert handle.is_cancelled()


def test_set_thread_and_join_calls_thread_join_with_timeout():
handle = SubscriptionHandle()
mock_thread = Mock()
handle.set_thread(mock_thread)
handle.join(timeout=0.25)
mock_thread.join.assert_called_once_with(0.25)


def test_join_without_thread_raises_nothing():
handle = SubscriptionHandle()
# should not raise
handle.join()
2 changes: 2 additions & 0 deletions tools/_mypy_minimal.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy]
ignore_missing_imports = True