|
3 | 3 | )
|
4 | 4 | import pytest
|
5 | 5 |
|
6 |
| -from eth_utils import ( |
7 |
| - ValidationError, |
8 |
| -) |
9 | 6 | from eth_utils.toolz import (
|
10 | 7 | compose,
|
11 | 8 | )
|
|
15 | 12 | Web3,
|
16 | 13 | )
|
17 | 14 | from web3.exceptions import (
|
| 15 | + Web3ValidationError, |
18 | 16 | Web3ValueError,
|
19 | 17 | )
|
20 | 18 | from web3.method import (
|
@@ -160,34 +158,36 @@ def test_empty_mungers_for_property_with_no_input_parameters(empty):
|
160 | 158 | assert method.input_munger(object(), [], {}) == ()
|
161 | 159 |
|
162 | 160 |
|
163 |
| -def test_default_munger_for_property_with_input_parameters_raises_ValidationError(): |
| 161 | +def test_default_munger_for_property_with_input_params_raises_validation_error(): |
164 | 162 | method = Method(
|
165 | 163 | is_property=True,
|
166 | 164 | json_rpc_method="eth_method",
|
167 | 165 | )
|
168 | 166 | with pytest.raises(
|
169 |
| - ValidationError, match="Parameters cannot be passed to a property" |
| 167 | + Web3ValidationError, match="Parameters cannot be passed to a property" |
170 | 168 | ):
|
171 | 169 | method.input_munger(object(), [1], {})
|
172 | 170 |
|
173 | 171 |
|
174 | 172 | @pytest.mark.parametrize(
|
175 | 173 | "empty", ([], (), None), ids=["empty-list", "empty-tuple", "None"]
|
176 | 174 | )
|
177 |
| -def test_empty_mungers_for_property_with_input_parameters_raises_ValidationError(empty): |
| 175 | +def test_empty_mungers_for_property_with_input_params_raises_validation_error(empty): |
178 | 176 | method = Method(
|
179 | 177 | is_property=True,
|
180 | 178 | mungers=empty,
|
181 | 179 | json_rpc_method="eth_method",
|
182 | 180 | )
|
183 | 181 | with pytest.raises(
|
184 |
| - ValidationError, match="Parameters cannot be passed to a property" |
| 182 | + Web3ValidationError, match="Parameters cannot be passed to a property" |
185 | 183 | ):
|
186 | 184 | method.input_munger(object(), [1], {})
|
187 | 185 |
|
188 | 186 |
|
189 |
| -def test_property_with_mungers_raises_ValidationError(): |
190 |
| - with pytest.raises(ValidationError, match="Mungers cannot be used with a property"): |
| 187 | +def test_property_with_mungers_raises_validation_error(): |
| 188 | + with pytest.raises( |
| 189 | + Web3ValidationError, match="Mungers cannot be used with a property" |
| 190 | + ): |
191 | 191 | Method(
|
192 | 192 | is_property=True,
|
193 | 193 | mungers=[lambda m, z, y: "success"],
|
|
0 commit comments