File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212from hiero_sdk_python .crypto .key_list import KeyList
1313from hiero_sdk_python .crypto .private_key import PrivateKey
1414from hiero_sdk_python .Duration import Duration
15+ from hiero_sdk_python .exceptions import PrecheckError
1516from hiero_sdk_python .hbar import Hbar
1617from hiero_sdk_python .query .account_info_query import AccountInfoQuery
1718from hiero_sdk_python .response_code import ResponseCode
@@ -283,10 +284,11 @@ def test_account_update_insufficient_fee_with_valid_expiration_bump(env):
283284 if not _apply_tiny_max_fee_if_supported (tx , env .client ):
284285 pytest .skip ("SDK lacks a max-fee API; cannot deterministically trigger INSUFFICIENT_TX_FEE." )
285286
286- receipt = tx .execute (env .client )
287- assert receipt .status == ResponseCode .INSUFFICIENT_TX_FEE , (
288- f"Expected INSUFFICIENT_TX_FEE but got { ResponseCode (receipt .status ).name } "
289- )
287+ # If it succeeds or raises a different error, the test will fail.
288+ with pytest .raises (PrecheckError ) as exc_info :
289+ tx .execute (env .client )
290+
291+ assert exc_info .value .status == ResponseCode .INSUFFICIENT_TX_FEE
290292
291293 # Confirm expiration time did not change
292294 info_after = AccountInfoQuery (account_id ).execute (env .client )
You can’t perform that action at this time.
0 commit comments