From ec96cc3ab137161fda1cdbe2e9c43c0cd725799c Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Wed, 23 Oct 2024 19:58:46 -0400 Subject: [PATCH] add a unit test --- .../contracts/vyper/test_vyper_contract.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/unitary/contracts/vyper/test_vyper_contract.py b/tests/unitary/contracts/vyper/test_vyper_contract.py index b522e935..93d43591 100644 --- a/tests/unitary/contracts/vyper/test_vyper_contract.py +++ b/tests/unitary/contracts/vyper/test_vyper_contract.py @@ -72,3 +72,20 @@ def foo() -> bool: c = boa.loads(code) c.foo() + + +def test_contract_name(): + code = """ +@external +def foo() -> bool: + return True + """ + c = boa.loads(code, name="return_one", filename="return_one.vy") + + assert c.contract_name == "return_one" + assert c.filename == "return_one.vy" + + c = boa.loads(code, filename="a/b/return_one.vy") + + assert c.contract_name == "VyperContract" + assert c.filename == "a/b/return_one.vy"