Skip to content

Commit

Permalink
add a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Oct 23, 2024
1 parent 2c84cba commit ec96cc3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unitary/contracts/vyper/test_vyper_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit ec96cc3

Please sign in to comment.