Пример #1
0
# Root base classes.


class Root(object):
    @story
    def i(I):
        I.start
        I.a
        I.finish


contract_in(
    Root,
    Validator(
        {
            "fizz": {"type": "integer", "coerce": int},
            "buzz": {"type": "integer", "coerce": int},
        }
    ),
)


class RootWithSame(object):
    @story
    def i(I):
        I.start
        I.a
        I.finish


contract_in(
Пример #2
0
        "bar": list_of(integer),
        "baz": integer
    }))

# Root base classes.


class Root(object):
    @story
    def i(I):
        I.start
        I.a
        I.finish


contract_in(Root, {"fizz": integer, "buzz": integer})


class RootWithSame(object):
    @story
    def i(I):
        I.start
        I.a
        I.finish


contract_in(RootWithSame, {
    "foo": integer,
    "bar": list_of(integer),
    "baz": integer
})