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