add test for master/slave and callback
This commit is contained in:
@ -591,7 +591,11 @@ class Settings(object):
|
||||
#mandatory
|
||||
if 'mandatory' in properties or 'empty' in properties:
|
||||
value = 'pouet'
|
||||
if self.validate_mandatory(opt_or_descr, index, value, properties):
|
||||
if self.validate_mandatory(opt_or_descr,
|
||||
index,
|
||||
value,
|
||||
setting_properties,
|
||||
properties):
|
||||
properties += set(['mandatory']) - set(['empty'])
|
||||
else:
|
||||
properties -= set(['mandatory', 'empty'])
|
||||
@ -617,15 +621,21 @@ class Settings(object):
|
||||
datas,
|
||||
opt_type)
|
||||
|
||||
def validate_mandatory(self, opt, index, value, properties):
|
||||
def validate_mandatory(self,
|
||||
opt,
|
||||
index,
|
||||
value,
|
||||
setting_properties,
|
||||
properties):
|
||||
values = self._getcontext().cfgimpl_get_values()
|
||||
return 'mandatory' in properties and values.isempty(opt,
|
||||
value,
|
||||
index=index) or \
|
||||
'empty' in properties and values.isempty(opt,
|
||||
value,
|
||||
force_allow_empty_list=True,
|
||||
index=index)
|
||||
return 'mandatory' in setting_properties and \
|
||||
('mandatory' in properties and values.isempty(opt,
|
||||
value,
|
||||
index=index) or \
|
||||
'empty' in properties and values.isempty(opt,
|
||||
value,
|
||||
force_allow_empty_list=True,
|
||||
index=index))
|
||||
|
||||
#____________________________________________________________
|
||||
# read only/read write
|
||||
|
Reference in New Issue
Block a user