Merge branch 'master' into develop

This commit is contained in:
Romain Dorgueil
2018-08-11 15:04:35 +02:00
45 changed files with 257 additions and 205 deletions

View File

@ -5,6 +5,7 @@ from unittest.mock import patch
import pytest
from bonobo import settings
from bonobo.errors import ValidationError
TEST_SETTING = "TEST_SETTING"
@ -38,6 +39,15 @@ def test_setting():
s.clear()
assert s.get() == "hello"
s = settings.Setting(TEST_SETTING, default=0, validator=lambda x: x == 42)
with pytest.raises(ValidationError):
assert s.get() is 0
s.set(42)
with pytest.raises(ValidationError):
s.set(21)
def test_default_settings():
settings.clear_all()