The Contracts SDK comes with unit test utilities; these are base classes that should be used in Contract unit tests. There are separate base classes for each Contracts API version and for Smart or Supervisor Contracts.
Smart Contract unit test utilities
In the example below, the SmartContracts340TestCase class is based on the TestCase class of the unittest Python built-in module. SmartContracts340TestCase also has the run_contract_function method that is used to run Contract hooks and helper functions, and the mocked vault object that should be used to mock data received by the Contract.