add force_permissive in mandatory_warnings

This commit is contained in:
2014-10-26 16:39:24 +01:00
parent f730050f7c
commit c75867720f
4 changed files with 22 additions and 7 deletions

View File

@ -211,6 +211,7 @@ def test_mandatory_warnings_ro():
config.str = 'a'
config.read_only()
assert config.cfgimpl_get_values().mandatory_warnings() == ['str1', 'unicode2', 'str3']
assert list(config.cfgimpl_get_values().mandatory_warnings(force_permissive=True)) == ['str1', 'unicode2', 'str3']
sleep(.1)
@ -223,6 +224,7 @@ def test_mandatory_warnings_rw():
assert config.cfgimpl_get_values().mandatory_warnings() == ['str', 'str1', 'unicode2', 'str3']
config.str = 'a'
assert config.cfgimpl_get_values().mandatory_warnings() == ['str1', 'unicode2', 'str3']
assert list(config.cfgimpl_get_values().mandatory_warnings(force_permissive=True)) == ['str1', 'unicode2', 'str3']
sleep(.1)
@ -236,9 +238,24 @@ def test_mandatory_warnings_disabled():
assert config.cfgimpl_get_values().mandatory_warnings() == ['str', 'str1', 'unicode2', 'str3']
setting[descr.str].append('disabled')
assert config.cfgimpl_get_values().mandatory_warnings() == ['str1', 'unicode2', 'str3']
assert list(config.cfgimpl_get_values().mandatory_warnings(force_permissive=True)) == ['str1', 'unicode2', 'str3']
sleep(.1)
def test_mandatory_warnings_hidden():
descr = make_description()
config = Config(descr)
config.str = ''
setting = config.cfgimpl_get_settings()
config.read_write()
config.cfgimpl_get_settings().setpermissive(('hidden',))
config.str
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
setting[descr.str].append('hidden')
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str1', 'unicode2', 'str3']
assert list(config.cfgimpl_get_values().mandatory_warnings(force_permissive=True)) == ['str', 'str1', 'unicode2', 'str3']
def test_mandatory_warnings_frozen():
descr = make_description()
config = Config(descr)