I built a module with Cairo language and I would like to unit test it. The contract is pretty simple : it manages a list of authorized addresses and provide some "modifier" functions to help.
I have taken the sample unit testing code from the documentation but nothing is referring about sending an account address to a function with python.
How should I proceed ?
Thanks in advance
You can spoof an account by providing the caller address to the invoke function like this:
If you want a more detailed example of how the python unit testing framework works you can check these 2 links
https://github.com/starknet-edu/basecamp/blob/main/camp_4/buidl/tests/test_contract.py https://github.com/starknet-edu/starknet-debug/tree/master/python