don't display warning in mandatory_warnings

This commit is contained in:
2016-10-14 21:31:39 +02:00
parent 2e4fdbca03
commit 24ec5a9112
5 changed files with 58 additions and 45 deletions

View File

@ -400,7 +400,6 @@ def test_mandatory_warnings_ro():
config.str = 'a'
config.read_only()
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str1', 'unicode2', 'str3']
assert list(config.cfgimpl_get_values().mandatory_warnings(force_permissive=True)) == ['str1', 'unicode2', 'str3']
try:
delete_session('config', config.impl_getsessionid())
except ValueError:
@ -417,7 +416,6 @@ def test_mandatory_warnings_rw():
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
config.str = 'a'
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str1', 'unicode2', 'str3']
assert list(config.cfgimpl_get_values().mandatory_warnings(force_permissive=True)) == ['str1', 'unicode2', 'str3']
try:
delete_session('config', 'man100')
except ValueError:
@ -435,7 +433,6 @@ def test_mandatory_warnings_disabled():
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
setting[descr.str].append('disabled')
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str1', 'unicode2', 'str3']
assert list(config.cfgimpl_get_values().mandatory_warnings(force_permissive=True)) == ['str1', 'unicode2', 'str3']
try:
delete_session('config', 'man101')
except ValueError:
@ -453,8 +450,7 @@ def test_mandatory_warnings_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']
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
try:
delete_session('config', 'man102')
except ValueError:
@ -673,10 +669,8 @@ def test_mandatory_warnings_validate():
config = Config(descr, session_id='man111')
config.str = ''
raises(ValueError, "list(config.cfgimpl_get_values().mandatory_warnings())")
assert list(config.cfgimpl_get_values().mandatory_warnings(validate=False)) == ['str', 'str1', 'str3', 'unicode1', 'int1']
config.str = 'test'
raises(ValueError, "list(config.cfgimpl_get_values().mandatory_warnings())")
assert list(config.cfgimpl_get_values().mandatory_warnings(validate=False)) == ['str1', 'str3']
try:
delete_session('config', 'man111')
except ValueError:
@ -689,8 +683,7 @@ def test_mandatory_warnings_validate_empty():
config = Config(descr, session_id='man112')
config.str = ''
config.read_only()
raises(ConfigError, "list(config.cfgimpl_get_values().mandatory_warnings())")
assert list(config.cfgimpl_get_values().mandatory_warnings(validate=False)) == ['str', 'str1', 'str3', 'unicode1']
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'str3', 'unicode1']
try:
delete_session('config', 'man112')
except ValueError: