remove all getapi in tests

This commit is contained in:
2018-08-15 08:35:22 +02:00
parent 6b6fa5e499
commit f6e963ae38
5 changed files with 689 additions and 1013 deletions

View File

@ -53,7 +53,10 @@ class TiramisuHelp:
modules.sort()
for module_name in modules:
module = self.registers[module_name]
instance_module = module(None)
try:
instance_module = module(None)
except TypeError:
instance_module = module(None, None, None)
if isinstance(instance_module, TiramisuDispatcher):
if _valid and not getdoc(module.__call__): # pragma: no cover
raise Exception('unknown doc for {}'.format('__call__'))
@ -143,9 +146,11 @@ class CommonTiramisuOption(CommonTiramisu):
self.option_bag = option_bag
self._name = name
self.subconfig = subconfig
self._get_option()
if option_bag.config_bag is not None and self.slave_need_index:
self._test_slave_index()
if option_bag is not None:
# for help()
self._get_option()
if option_bag.config_bag is not None and self.slave_need_index:
self._test_slave_index()
def _test_slave_index(self) -> None:
option = self.option_bag.option
@ -262,7 +267,9 @@ class TiramisuOptionOwner(CommonTiramisuOption):
super().__init__(name,
subconfig,
option_bag)
self.values = self.option_bag.config_bag.context.cfgimpl_get_values()
if option_bag is not None:
# for help()
self.values = self.option_bag.config_bag.context.cfgimpl_get_values()
def get(self):
"""get owner for a specified option"""
@ -298,7 +305,7 @@ class TiramisuOptionProperty(CommonTiramisuOption):
super().__init__(name,
subconfig,
option_bag)
if option_bag.config_bag:
if option_bag and option_bag.config_bag:
self.settings = option_bag.config_bag.context.cfgimpl_get_settings()
def get(self, apply_requires=True):
@ -350,7 +357,7 @@ class TiramisuOptionPermissive(CommonTiramisuOption):
super().__init__(name,
subconfig,
option_bag)
if option_bag.config_bag:
if option_bag and option_bag.config_bag:
self.settings = option_bag.config_bag.context.cfgimpl_get_settings()
def get(self):