Skip to content

Commit 835c369

Browse files
committed
verify: error types
1 parent 3d9c5d5 commit 835c369

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/integration/token_pause_transaction_e2e_test.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,23 @@ def pausable_token(env):
3939
def unpausable_token(env):
4040
return create_fungible_token(env)
4141

42+
@mark.integration
43+
def test_pause_transaction_precheck_vs_receipt_behavior():
44+
env = IntegrationTestEnv()
45+
try:
46+
tx = TokenPauseTransaction().set_token_id(TokenId(0, 0, 99999999))
47+
48+
try:
49+
result = tx.execute(env.client)
50+
except ReceiptStatusError as e:
51+
pytest.skip(f"SDK raises ReceiptStatusError: {e}")
52+
except PrecheckError as e:
53+
pytest.skip(f"SDK raises PrecheckError: {e}")
54+
else:
55+
pytest.skip(f"SDK returns a receipt with status: {result.status}")
56+
finally:
57+
env.close()
58+
4259
@mark.integration
4360
def test_pause_missing_token_id_raises_value_error(env):
4461
"""
@@ -58,10 +75,12 @@ def test_pause_nonexistent_token_id_raises_precheck_error(env):
5875
fake = TokenId(0, 0, 99999999)
5976
tx = TokenPauseTransaction().set_token_id(fake)
6077

61-
with pytest.raises(PrecheckError, match=ResponseCode.get_name(ResponseCode.INVALID_TOKEN_ID)):
78+
with pytest.raises(ReceiptStatusError, match=ResponseCode.get_name(ResponseCode.INVALID_TOKEN_ID)):
6279
# .execute() will auto‐freeze and auto‐sign with the operator key
6380
tx.execute(env.client) # ← this is what runs the precheck
6481

82+
83+
6584
@mark.integration
6685
def test_pause_fails_for_unpausable_token(env, unpausable_token):
6786
"""

0 commit comments

Comments
 (0)