mock and doctests