Fixed a bug when mocking failed.

Signed-off-by: crynobone <crynobone@gmail.com>
Add typehint.

Signed-off-by: crynobone <crynobone@gmail.com>