0

My question is simple. Is it possible to write a unit test in python (Brownie) for a library using a struct from it?

I found something interesting in another question, but it does not seem working in locally. How to test internal members of solidity library or contract in brownie?

When I am trying to use my struct I get this error:

    def test_simple_applications():
        course_helper = CourseHelper.deploy({'from': accounts[0]})
>       course = CourseHelper.Course()
E       AttributeError: 'ContractContainer' object has no attribute 'Course'

1 Answer 1

0

The current method I know to test the library is to create a helper contract and wrap the library, and you test the helper contract with brownie.

Do you have your source code that defines the contract? You can first check if you have a variable named course instead of Course in the contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.