mockify.actions - Classes for recording side effects¶
Module containing predefined actions that can be used as argument for
Basically, any class containing following methods is considered an action:
Returning string representation of an action.
This is used for error reporting.
__call__(self, *args, **kwargs)
Method that is called when mock is called.
Entire action logic goes in here.
Makes mock invoking given function when called.
When mock is called, all arguments (if there are any) are passed to the
funcand its return value is returned as mock’s return value.
Parameters: func – Function to be executed
Makes mock raising given exception when called.
Parameters: exc – Instance of exception to be raised