Exemplo n.º 1
0
    def test_add_field_failed(self):
        schema = Schema()
        config = Config(schema)

        with pytest.raises(AttributeError):
            config._set_value('hello', 'world')
Exemplo n.º 2
0
 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)