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

    f1 = Field(int)

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

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