Beispiel #1
0
 class MyRecord(Record):
     v = one_of('a', 'b', 'c', coerce=text_type.lower)
Beispiel #2
0
 class MyRecord(Record):
     v = one_of('a', 'b', 'c', nullable=True)
Beispiel #3
0
 class MyRecord(Record):
     v = one_of('a', 'b', 'c', nullable=True, default='z')
Beispiel #4
0
 class MyRecord(Record):
     v = nullable(one_of('a', 'b', 'c'))
Beispiel #5
0
 class MyRecord(Record):
     c = one_of(c1)
Beispiel #6
0
def _():
    with assert_raises(ValueError):
        one_of('a', object())
Beispiel #7
0
def _():
    with assert_raises(ValueError):
        one_of()
Beispiel #8
0
 class MyRecord(Record):
     v = one_of('a', 'b', 'c')