def test_input_munger_parameter_passthrough_mismatch_arity(): method = Method( mungers=[lambda m, z, y: 'success'], json_rpc_method='eth_method', ) with pytest.raises(TypeError): method.input_munger(object(), ['first', 'second', 'third'], {})
def test_default_input_munger_with_input_parameters_exception(): method = Method( mungers=[], json_rpc_method='eth_method', ) with pytest.raises(TypeError): method.input_munger(object(), [1], {})
def test_default_munger_for_property_with_input_parameters_raises_ValidationError( ): method = Method( is_property=True, json_rpc_method='eth_method', ) with pytest.raises(ValidationError, match='Parameters cannot be passed to a property'): method.input_munger(object(), [1], {})
def test_input_munger_parameter_passthrough_matching_arity(): method = Method( mungers=[lambda m, z, y: ['success']], json_rpc_method='eth_method', ) assert method.input_munger(object(), ['first', 'second'], {}) == ['success']
def test_empty_mungers_for_property_with_no_input_parameters(empty): method = Method( is_property=True, mungers=empty, json_rpc_method='eth_method', ) assert method.input_munger(object(), [], {}) == ()
def test_default_input_munger_with_no_input_parameters(): method = Method(json_rpc_method='eth_method', ) assert method.input_munger(object(), [], {}) == []
def test_default_munger_for_property_with_no_input_parameters(): method = Method( is_property=True, json_rpc_method='eth_method', ) assert method.input_munger(object(), [], {}) == ()
def test_empty_input_mungers_with_input_parameters(empty): method = Method( mungers=empty, json_rpc_method='eth_method', ) assert method.input_munger(object(), [1], {}) == [1]
def test_input_munger_falsy_config_result_in_default_munger(): method = Method(mungers=[], json_rpc_method='eth_method', formatter_lookup_fn='') method.input_munger((object(), [], {})) == []
def test_input_munger_parameter_passthrough_matching_arity(): method = Method(mungers=[lambda m, z, y: ['success']], json_rpc_method='eth_method', formatter_lookup_fn='') method.input_munger((object(), ['first', 'second'], {})) == 'success'
def test_input_munger_falsy_config_result_in_default_munger(): method = Method( mungers=[], json_rpc_method='eth_method', ) method.input_munger(object(), [], {}) == []