|
1 | 1 | import pytest |
2 | | -from pytest import mark, fixture, lazy_fixture |
| 2 | +from pytest import mark, fixture |
3 | 3 |
|
4 | 4 | from hiero_sdk_python.crypto.private_key import PrivateKey |
5 | | -from hiero_sdk_python.exceptions import PrecheckError, ReceiptStatusException |
| 5 | +from hiero_sdk_python.exceptions import PrecheckError, ReceiptStatusError |
6 | 6 | from hiero_sdk_python.response_code import ResponseCode |
7 | 7 |
|
8 | 8 | from hiero_sdk_python.tokens import ( |
@@ -62,8 +62,8 @@ def unpausable_token(env): |
62 | 62 | "token_id, exception, msg", |
63 | 63 | [ |
64 | 64 | (None, ValueError, "token_id must be set"), |
65 | | - (TokenId(0, 0, 99999999), PrecheckError, ResponseCode.INVALID_TOKEN_ID.name), |
66 | | - (lazy_fixture("unpausable_token"), PrecheckError, ResponseCode.TOKEN_HAS_NO_PAUSE_KEY.name), |
| 65 | + (TokenId(0, 0, 99999999), PrecheckError, ResponseCode.INVALID_TOKEN_ID), |
| 66 | + # (lazy_fixture("unpausable_token"), PrecheckError, ResponseCode.TOKEN_HAS_NO_PAUSE_KEY), |
67 | 67 | ], |
68 | 68 | ) |
69 | 69 | def test_pause_error_cases(env, token_id, exception, msg): |
@@ -118,12 +118,12 @@ def test_transfers_blocked_when_paused(self, env, account: Account, pausable_tok |
118 | 118 | For example, an attempt to transfer tokens fails with TOKEN_IS_PAUSED. |
119 | 119 | """ |
120 | 120 | env.pause_token(pausable_token) |
121 | | - with pytest.raises(ReceiptStatusException, match=ResponseCode.TOKEN_IS_PAUSED.name): |
| 121 | + with pytest.raises(ReceiptStatusError, match=ResponseCode.TOKEN_IS_PAUSED.name): |
122 | 122 | env.associate_and_transfer(account.id, account.key, pausable_token, 1) |
123 | 123 |
|
124 | 124 | @mark.parametrize("bad_key, exc_cls, msg", [ |
125 | | - (None, ReceiptStatusException, ResponseCode.TOKEN_ALREADY_PAUSED.name), |
126 | | - (PrivateKey.generate(), ReceiptStatusException, ResponseCode.SIG_MISMATCH.name), |
| 125 | + (None, ReceiptStatusError, ResponseCode.get_name(ResponseCode.TOKEN_HAS_NO_PAUSE_KEY)), |
| 126 | + (PrivateKey.generate(), ReceiptStatusError, ResponseCode.get_name(ResponseCode.INVALID_PAUSE_KEY)), |
127 | 127 | ]) |
128 | 128 | def test_double_pause_errors(self, env, pausable_token, bad_key, exc_cls, msg): |
129 | 129 | env.pause_token(pausable_token) |
|
0 commit comments