File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -337,11 +337,11 @@ def test_process_params(
337
337
object (), * args , ** kwargs
338
338
)
339
339
assert request_params == expected_request_result
340
- first_formatter = (output_formatter [0 ].first ,)
341
- all_other_formatters = output_formatter [0 ].funcs
342
340
343
- # the expected result formatters length is 2
344
- assert len (first_formatter + all_other_formatters ) == 2
341
+ first_formatter = (output_formatter [0 ],)
342
+
343
+ # the expected result formatters length is 1
344
+ assert len (first_formatter ) == 1
345
345
346
346
347
347
def keywords (module , keyword_one , keyword_two ):
Original file line number Diff line number Diff line change 15
15
AsyncEth ,
16
16
)
17
17
from web3 .middleware import (
18
+ async_attrdict_middleware ,
18
19
async_construct_result_generator_middleware ,
19
20
async_local_filter_middleware ,
21
+ attrdict_middleware ,
20
22
construct_result_generator_middleware ,
21
23
local_filter_middleware ,
22
24
)
@@ -105,6 +107,7 @@ def w3_base():
105
107
@pytest .fixture (scope = "function" )
106
108
def w3 (w3_base , result_generator_middleware ):
107
109
w3_base .middleware_onion .add (result_generator_middleware )
110
+ w3_base .middleware_onion .add (attrdict_middleware )
108
111
w3_base .middleware_onion .add (local_filter_middleware )
109
112
return w3_base
110
113
@@ -284,6 +287,7 @@ def async_w3_base():
284
287
@pytest .fixture (scope = "function" )
285
288
def async_w3 (async_w3_base , async_result_generator_middleware ):
286
289
async_w3_base .middleware_onion .add (async_result_generator_middleware )
290
+ async_w3_base .middleware_onion .add (async_attrdict_middleware )
287
291
async_w3_base .middleware_onion .add (async_local_filter_middleware )
288
292
return async_w3_base
289
293
Original file line number Diff line number Diff line change 20
20
Geth ,
21
21
)
22
22
from web3 .middleware import (
23
+ async_attrdict_middleware ,
23
24
async_buffered_gas_estimate_middleware ,
24
25
async_gas_price_strategy_middleware ,
25
26
async_validation_middleware ,
@@ -63,12 +64,13 @@ def test_web3_with_async_http_provider_has_default_middlewares_and_modules() ->
63
64
64
65
# the following length check should fail and will need to be added to once more
65
66
# async middlewares are added to the defaults
66
- assert len (async_w3 .middleware_onion .middlewares ) == 3
67
+ assert len (async_w3 .middleware_onion .middlewares ) == 4
67
68
68
69
assert (
69
70
async_w3 .middleware_onion .get ("gas_price_strategy" )
70
71
== async_gas_price_strategy_middleware
71
72
)
73
+ assert async_w3 .middleware_onion .get ("attrdict" ) == async_attrdict_middleware
72
74
assert async_w3 .middleware_onion .get ("validation" ) == async_validation_middleware
73
75
assert (
74
76
async_w3 .middleware_onion .get ("gas_estimate" )
You can’t perform that action at this time.
0 commit comments