coverages

This commit is contained in:
2018-09-15 22:44:49 +02:00
parent 84d1f85b90
commit 2d063f8170
16 changed files with 163 additions and 95 deletions

View File

@ -106,7 +106,7 @@ rw_remove = set(['permissive', 'everything_frozen', 'mandatory', 'empty'])
FORBIDDEN_SET_PROPERTIES = frozenset(['force_store_value'])
FORBIDDEN_SET_PERMISSIVES = frozenset(['force_default_on_freeze'])
FORBIDDEN_SET_PERMISSIVES = frozenset(['force_default_on_freeze', 'force_default_on_freeze'])
log = getLogger('tiramisu')
@ -154,12 +154,12 @@ class OptionBag:
return self.option
elif key == 'apply_requires':
return True
raise KeyError('unknown key {} for OptionBag'.format(key))
raise KeyError('unknown key {} for OptionBag'.format(key)) # pragma: no cover
def __delattr__(self, key):
if key == 'properties':
return
raise KeyError('unknown key {} for ConfigBag'.format(key))
raise KeyError('unknown key {} for ConfigBag'.format(key)) # pragma: no cover
def copy(self):
kwargs = {}
@ -186,7 +186,7 @@ class ConfigBag:
if key == 'permissives':
self.permissives = self.context.cfgimpl_get_settings().get_context_permissives()
return self.permissives
raise KeyError('unknown key {} for ConfigBag'.format(key))
raise KeyError('unknown key {} for ConfigBag'.format(key)) # pragma: no cover
def remove_validation(self):
self.properties = frozenset(self.properties - {'validator'})
@ -201,7 +201,7 @@ class ConfigBag:
except AttributeError:
pass
return
raise KeyError('unknown key {} for ConfigBag'.format(key))
raise KeyError('unknown key {} for ConfigBag'.format(key)) # pragma: no cover
#def __setattr__(self, key, value):
# super().__setattr__(key, value)
@ -610,10 +610,7 @@ class Settings(object):
#values too because of slave values could have a PropertiesOptionError has value
context.cfgimpl_reset_cache(option_bag)
if option_bag is not None:
try:
del option_bag.properties
except AttributeError:
pass
del option_bag.properties
def set_context_permissives(self,
permissives):
@ -661,7 +658,7 @@ class Settings(object):
opt = None
else:
opt = option_bag.option
if all_properties and option_bag:
if all_properties and option_bag: # pragma: no cover
raise ValueError(_('opt and all_properties must not be set '
'together in reset'))
if opt and opt.impl_is_symlinkoption():