Mock objects and patching