Improve tests by using autospec mocks