def mock_capa_module():
 capa_module = Mock()
 capa_module.location.to_deprecated_string.return_value = 'i4x://Foo/bar/mock/abc'
 return capa_module

def mock_capa_module ( ) : capa_module = Mock ( ) capa_module . location . to_deprecated_string . return_value = 'i4x://Foo/bar/mock/abc' return capa_module
capa response types needs just two things from the capa_module: location and track_function .