示例#1
0
def test_field_validator_is_Schema():
    from schema import Schema

    f1 = Field(int)

    assert isinstance(f1.validator, Schema)
示例#2
0
 class MockFact(Fact):
     myfield = Field(int, mandatory=True)
示例#3
0
def test_field_default_is_NODEFAULT():
    f1 = Field(int)

    assert f1.default is Field.NODEFAULT
示例#4
0
 class MockFact(Fact):
     myfield = Field(int, default=lambda: 0)
示例#5
0
 class MockFact(Fact):
     myfield = Field(int)
示例#6
0
 class MockFact(Fact):
     myfield = Field(int)
     somethingelse = int
示例#7
0
 class MockFact(Fact):
     myfield = Field(int, default=0)
示例#8
0
 class MyFact(Fact):
     _0 = Field(int)
示例#9
0
 class MockFact(Fact):
     myfield = Field(str, default=mymock)
示例#10
0
 class MockFact(MockFactBase):
     mybasefield = Field(str, default="notbase")
     myfield = Field(str, default="class")
示例#11
0
 class MockFactBase(Fact):
     mybasefield = Field(str, default="base")
示例#12
0
 class MockFact(MockFactBase):
     myfield = Field(str, default="class")