def test_getattr_dynamic(self): schema = Schema(dynamic=True) config = schema() assert config.x is None
def test_get_annotation_typestr_schema(self): schema = Schema() assert get_annotation_typestr(schema) == 'cincoconfig.config.Schema'
def test_getattr_error(self): schema = Schema() config = schema() with pytest.raises(AttributeError): x = config.x
def test_call(self): schema = Schema() cfg = schema() assert isinstance(cfg, Config) assert cfg._schema is schema
def test_getattr_new(self): schema = Schema() field = schema.field assert isinstance(field, Schema) assert field._key == 'field'
def test_getattr(self): schema = Schema() field = Field() schema.field = field assert schema.field is field
def test_getitem_keyerror_not_schema(self): schema = Schema() schema.x = Field() with pytest.raises(KeyError): y = schema['x.y']
def test_getitem_keyerror(self): schema = Schema() with pytest.raises(KeyError): x = schema['x']