def test_add_field_failed(self): schema = Schema() config = Config(schema) with pytest.raises(AttributeError): config._set_value('hello', 'world')
def test_add_field_dynamic(self): schema = Schema(dynamic=True) config = Config(schema) assert config._set_value('hello', 'world') == 'world' assert config._data['hello'] == 'world' assert isinstance(config._fields['hello'], AnyField)