adapt tests
This commit is contained in:
@ -567,6 +567,7 @@ class Settings(object):
|
||||
if self._getcontext().cfgimpl_get_meta() is not None:
|
||||
raise ConfigError(_('cannot change property with metaconfig'))
|
||||
if path is not None and config_bag.option.impl_getrequires() is not None:
|
||||
print(properties, getattr(config_bag.option, '_calc_properties', static_set))
|
||||
not_allowed_props = properties & getattr(config_bag.option, '_calc_properties', static_set)
|
||||
if not_allowed_props:
|
||||
if len(not_allowed_props) == 1:
|
||||
@ -575,9 +576,9 @@ class Settings(object):
|
||||
else:
|
||||
prop_msg = _('properties')
|
||||
calc_msg = _('those properties are calculated')
|
||||
raise ValueError(_('cannot set {} {} for option {} {}'
|
||||
raise ValueError(_('cannot set {} {} for option "{}" {}'
|
||||
'').format(prop_msg, display_list(list(not_allowed_props), add_quote=True),
|
||||
config_bag.option.impl_getname(),
|
||||
config_bag.option.impl_get_display_name(),
|
||||
calc_msg))
|
||||
if config_bag is None:
|
||||
opt = None
|
||||
@ -607,9 +608,17 @@ class Settings(object):
|
||||
raise ConfigError(_('cannot add this property: "{0}"').format(
|
||||
' '.join(property_)))
|
||||
|
||||
props = config_bag.option.impl_getproperties()
|
||||
print('add', property_)
|
||||
self_properties = config_bag.properties
|
||||
if self_properties is None:
|
||||
index = None
|
||||
self_properties = self.getproperties(path,
|
||||
index,
|
||||
config_bag,
|
||||
apply_requires=False)
|
||||
config_bag.properties = self_properties
|
||||
self.setproperties(path,
|
||||
props | {property_},
|
||||
self_properties | {property_},
|
||||
config_bag,
|
||||
force=True)
|
||||
|
||||
@ -617,9 +626,16 @@ class Settings(object):
|
||||
path,
|
||||
property_,
|
||||
config_bag):
|
||||
props = config_bag.option.impl_getproperties()
|
||||
self_properties = config_bag.properties
|
||||
if self_properties is None:
|
||||
index = None
|
||||
self_properties = self.getproperties(path,
|
||||
index,
|
||||
config_bag,
|
||||
apply_requires=False)
|
||||
config_bag.properties = self_properties
|
||||
self.setproperties(path,
|
||||
props - {property_},
|
||||
self_properties - {property_},
|
||||
config_bag,
|
||||
force=True)
|
||||
|
||||
|
Reference in New Issue
Block a user