def test_field_validator_is_Schema(): from schema import Schema f1 = Field(int) assert isinstance(f1.validator, Schema)
class MockFact(Fact): myfield = Field(int, mandatory=True)
def test_field_default_is_NODEFAULT(): f1 = Field(int) assert f1.default is Field.NODEFAULT
class MockFact(Fact): myfield = Field(int, default=lambda: 0)
class MockFact(Fact): myfield = Field(int)
class MockFact(Fact): myfield = Field(int) somethingelse = int
class MockFact(Fact): myfield = Field(int, default=0)
class MyFact(Fact): _0 = Field(int)
class MockFact(Fact): myfield = Field(str, default=mymock)
class MockFact(MockFactBase): mybasefield = Field(str, default="notbase") myfield = Field(str, default="class")
class MockFactBase(Fact): mybasefield = Field(str, default="base")
class MockFact(MockFactBase): myfield = Field(str, default="class")