def sorted_invariant(s): intersection = set(s.before) & set(s.after) if intersection: raise InvariantException("Plugin wants to come before and after %r" % intersection)
def command_invariant(c): if c.__doc__ is None: raise InvariantException("Command has no documentation")
def recipe_invariant(r): # Size invariant. if len(r.recipe) != r.dimensions[0] * r.dimensions[1]: raise InvariantException("Recipe size is invalid")