Skip to content

Commit

Permalink
test: missing constructor function should not ignore constructor args
Browse files Browse the repository at this point in the history
  • Loading branch information
redshiftzero committed Apr 8, 2019
1 parent cba9538 commit 2d47ed2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/core/contracts/test_contract_constructor_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ def test_contract_constructor_abi_encoding_with_constructor_with_no_args(SimpleC
assert deploy_data == SIMPLE_CONSTRUCTOR_CODE


@pytest.mark.parametrize(
'args,kwargs',
(
(None, 'kwarg-is-ignored'),
('arg-is-ignored', None),
),
)
def test_contract_error_if_additional_args_are_supplied_with_no_constructor_fn(MathContract,
args, kwargs):
with pytest.raises(TypeError, match="Constructor args"):
MathContract._encode_constructor_data(args, kwargs)


@pytest.mark.parametrize(
'arguments',
(
Expand Down

0 comments on commit 2d47ed2

Please sign in to comment.