Addition of unit-tests for GlobalScriptContainer.
This commit is contained in:
parent
6f4b832263
commit
d2cb75b058
2 changed files with 90 additions and 1 deletions
|
|
@ -106,6 +106,7 @@ class GlobalScriptContainer(Container):
|
|||
callables from settings but a custom dict of tuples.
|
||||
|
||||
"""
|
||||
__BASE_SCRIPT_TYPECLASS = class_from_module(settings.BASE_SCRIPT_TYPECLASS)
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
|
|
@ -205,7 +206,9 @@ class GlobalScriptContainer(Container):
|
|||
for key, data in list(self.loaded_data.items()):
|
||||
try:
|
||||
typeclass = data.get("typeclass", settings.BASE_SCRIPT_TYPECLASS)
|
||||
self.typeclass_storage[key] = class_from_module(typeclass)
|
||||
script_typeclass = class_from_module(typeclass)
|
||||
assert issubclass(script_typeclass, self.__BASE_SCRIPT_TYPECLASS)
|
||||
self.typeclass_storage[key] = script_typeclass
|
||||
except Exception:
|
||||
logger.log_trace(
|
||||
f"GlobalScriptContainer could not start import global script {key}. "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue