Skip to content

Commit 55d02f0

Browse files
committed
failing codecov fix
1 parent 7667019 commit 55d02f0

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

tests/unit/token_fee_schedule_update_transaction_test.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
from __future__ import annotations
22

3+
from unittest.mock import MagicMock
4+
35
import pytest
46

57
from hiero_sdk_python.account.account_id import AccountId
8+
from hiero_sdk_python.channels import _Channel
69
from hiero_sdk_python.tokens.custom_fee import CustomFee
710
from hiero_sdk_python.tokens.custom_fixed_fee import CustomFixedFee
811
from hiero_sdk_python.tokens.token_fee_schedule_update_transaction import (
@@ -114,3 +117,30 @@ def test_build_transaction_body_with_empty_custom_fees(mock_account_ids):
114117
assert transaction_body.HasField("token_fee_schedule_update")
115118
assert transaction_body.token_fee_schedule_update.token_id == token_id._to_proto()
116119
assert len(transaction_body.token_fee_schedule_update.custom_fees) == 0
120+
121+
122+
def test_get_method_returns_token_service_method():
123+
channel = _Channel()
124+
token_service = MagicMock()
125+
channel._token = token_service
126+
127+
method = TokenFeeScheduleUpdateTransaction()._get_method(channel)
128+
129+
assert method.transaction == token_service.updateTokenFeeSchedule
130+
131+
132+
def test_get_method_raises_when_token_service_unavailable():
133+
channel = _Channel()
134+
135+
with pytest.raises(ValueError, match="Token service not available on channel"):
136+
TokenFeeScheduleUpdateTransaction()._get_method(channel)
137+
138+
139+
def test_repr_includes_token_id_and_fee_count(mock_account_ids):
140+
_, _, _, token_id, _ = mock_account_ids
141+
transaction = TokenFeeScheduleUpdateTransaction(token_id=token_id, custom_fees=[])
142+
143+
representation = repr(transaction)
144+
145+
assert "TokenFeeScheduleUpdateTransaction" in representation
146+
assert "fees=0" in representation

0 commit comments

Comments
 (0)