# Path: pyknow/fact.py
# class BaseField(metaclass=abc.ABCMeta):
#     @abc.abstractmethod
#     def validate(self, data):
#         """Raise an exception on invalid data."""
#         pass
# 
# class Field(BaseField):
# 
#     NODEFAULT = object()
# 
#     def __init__(self, schema_definition, mandatory=False, default=NODEFAULT):
#         self.validator = Schema(schema_definition)
#         self.mandatory = mandatory
#         self.default = default
# 
#     def validate(self, data):
#         self.validator.validate(unfreeze(data))


from pyknow.fact import BaseField, Field
    from schema import Schema


def test_basefield_interface():
    assert BaseField.__abstractmethods__ == {'validate'}


def test_field_validator_is_Schema():

    f1 = Field(int)

    assert isinstance(f1.validator, Schema)


def test_field_default_is_NODEFAULT():

# Path: pyknow/fact.py
# class BaseField(metaclass=abc.ABCMeta):
#     @abc.abstractmethod
#     def validate(self, data):
#         """Raise an exception on invalid data."""
#         pass
# 
# class Field(BaseField):
# 
#     NODEFAULT = object()
# 
#     def __init__(self, schema_definition, mandatory=False, default=NODEFAULT):
#         self.validator = Schema(schema_definition)
#         self.mandatory = mandatory
#         self.default = default
# 
#     def validate(self, data):
#         self.validator.validate(unfreeze(data))


# Path: tests/unit/test_field.py
from pyknow.fact import BaseField, Field
    from schema import Schema



def test_basefield_interface():
    assert BaseField.__abstractmethods__ == {'validate'}


def test_field_validator_is_Schema():

    f1 = Field(int)

    assert isinstance(f1.validator, Schema)


def test_field_default_is_NODEFAULT():

    f1 = Field(int)