def _GetTestData(cls): ids = [cros_patch.MakeChangeId() for _ in xrange(3)] changes = [cls._GetCrosInternalPatch(GetTestJson(ids[0]))] non_os = [cls._GetCrosPatch(GetTestJson(ids[1]))] conflicting = [cls._GetCrosInternalPatch(GetTestJson(ids[2]))] conflicting = [cros_patch.PatchException(x)for x in conflicting] pool = validation_pool.ValidationPool( constants.PUBLIC_OVERLAYS, '/fake/pathway', 1, 'testing', True, True, changes=changes, non_os_changes=non_os, conflicting_changes=conflicting) return pickle.dumps([pool, changes, non_os, conflicting])
def f(self, parent, *args, **kwargs): try: return functor(self, parent, *args, **kwargs) except gerrit.GerritException as e: if isinstance(e, gerrit.QueryNotSpecific): e = ( '%s\nSuggest you use gerrit numbers instead (prefixed with a ' "'chrome-internal:' if it's an internal change)." % e) new_exc = cros_patch.PatchException(parent, e) six.reraise(new_exc.__class__, new_exc, sys.exc_info()[2]) except cros_patch.PatchException as e: if e.patch.id == parent.id: raise new_exc = cros_patch.DependencyError(parent, e) six.reraise(new_exc.__class__, new_exc, sys.exc_info()[2])