holado 0.2.4__py3-none-any.whl → 0.2.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of holado might be problematic. Click here for more details.
- holado/__init__.py +62 -26
- holado/common/context/service_manager.py +10 -2
- holado/common/context/session_context.py +43 -12
- holado/common/handlers/object.py +14 -5
- holado/common/handlers/undefined.py +16 -6
- holado/holado_config.py +1 -0
- {holado-0.2.4.dist-info → holado-0.2.6.dist-info}/METADATA +1 -1
- {holado-0.2.4.dist-info → holado-0.2.6.dist-info}/RECORD +49 -48
- holado_core/common/block/scope_steps.py +2 -2
- holado_core/common/resource/persisted_method_to_call_manager.py +2 -2
- holado_core/common/tools/path_manager.py +8 -4
- holado_core/common/tools/tools.py +24 -7
- holado_grpc/api/rpc/grpc_client.py +122 -118
- holado_helper/docker/logging.conf +3 -1
- holado_helper/docker/run_holado_test_nonreg_in_docker.sh +28 -28
- holado_helper/docker/run_terminal_in_docker-with_docker_control.sh +27 -27
- holado_helper/docker/run_terminal_in_docker.sh +26 -26
- holado_helper/initialize_holado.py +72 -0
- holado_helper/script/action.py +21 -9
- holado_helper/script/initialize_script.py +8 -28
- holado_helper/script/script.py +2 -2
- holado_logging/__init__.py +5 -8
- holado_logging/common/logging/holado_logger.py +2 -2
- holado_logging/common/logging/log_config.py +43 -18
- holado_logging/common/logging/log_manager.py +20 -19
- holado_multitask/multitasking/multitask_manager.py +1 -1
- holado_multitask/multithreading/thread.py +8 -4
- holado_protobuf/ipc/protobuf/protobuf_messages.py +1 -1
- holado_scripting/common/tools/evaluate_parameters.py +23 -5
- holado_scripting/common/tools/expression_evaluator.py +115 -113
- holado_scripting/tests/behave/steps/scenario/if_steps.py +2 -2
- holado_scripting/text/interpreter/functions/function_hex_to_bytes.py +1 -1
- holado_scripting/text/interpreter/text_interpreter.py +20 -21
- holado_test/behave/behave_environment.py +31 -12
- holado_test/behave/independant_runner.py +3 -5
- holado_test/scenario/step_tools.py +13 -12
- holado_test/scenario/tester_tools.py +3 -1
- holado_value/common/tables/comparators/table_2_value_table_cell_comparator.py +1 -1
- holado_value/common/tables/converters/value_table_converter.py +1 -1
- holado_value/common/tables/value_table_cell.py +5 -1
- holado_value/common/tools/value.py +56 -33
- holado_value/common/tools/value_types.py +6 -0
- test_holado/environment.py +1 -1
- test_holado/features/NonReg/{ipc → holado_binary}/bit_series.feature +13 -0
- test_holado/features/NonReg/test_steps/common.feature +1 -1
- test_holado/logging.conf +3 -1
- {holado-0.2.4.dist-info → holado-0.2.6.dist-info}/WHEEL +0 -0
- {holado-0.2.4.dist-info → holado-0.2.6.dist-info}/licenses/LICENSE +0 -0
- /test_holado/features/NonReg/{ipc → holado_binary}/bit_series.error.feature +0 -0
holado/__init__.py
CHANGED
|
@@ -27,7 +27,7 @@ except:
|
|
|
27
27
|
with_behave = False
|
|
28
28
|
|
|
29
29
|
logger = None
|
|
30
|
-
|
|
30
|
+
__initialized = False
|
|
31
31
|
|
|
32
32
|
def __initialize_holado_loggers():
|
|
33
33
|
global logger
|
|
@@ -38,27 +38,29 @@ def __initialize_holado_loggers():
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def _initialize_logging(
|
|
41
|
+
def _initialize_logging(use_holado_logger=True, logging_config_file_path=None, log_level=None, log_on_console=False, log_in_file=True):
|
|
42
42
|
# print_imported_modules("[initialize]")
|
|
43
43
|
import holado_logging
|
|
44
44
|
# print_imported_modules("[after import holado_logging]")
|
|
45
45
|
|
|
46
46
|
# Configure logging module
|
|
47
|
-
holado_logging.configure(
|
|
47
|
+
holado_logging.configure(use_holado_logger=use_holado_logger, logging_config_file_path=logging_config_file_path, log_level=log_level, log_on_console=log_on_console, log_in_file=log_in_file)
|
|
48
48
|
# print_imported_modules("[after import holado_logging]")
|
|
49
49
|
|
|
50
50
|
# Initialize holado loggers
|
|
51
51
|
__initialize_holado_loggers()
|
|
52
52
|
|
|
53
|
-
#
|
|
54
|
-
holado_logging.register()
|
|
55
|
-
|
|
56
|
-
# Configure log manager
|
|
53
|
+
# Create session context
|
|
57
54
|
from holado.common.context.session_context import SessionContext
|
|
58
|
-
SessionContext.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
if SessionContext.has_instance():
|
|
56
|
+
from holado_core.common.exceptions.technical_exception import TechnicalException
|
|
57
|
+
raise TechnicalException(f"Session context was initialized to early (before logging configuration)")
|
|
58
|
+
SessionContext.instance()
|
|
59
|
+
|
|
60
|
+
# Initialize log manager and register it in session context
|
|
61
|
+
holado_logging.initialize_and_register()
|
|
62
|
+
|
|
63
|
+
# Set whole logging configuration
|
|
62
64
|
SessionContext.instance().log_manager.set_config()
|
|
63
65
|
|
|
64
66
|
def change_logging_config(log_level=None, log_on_console=False, log_in_file=True):
|
|
@@ -70,54 +72,78 @@ def change_logging_config(log_level=None, log_on_console=False, log_in_file=True
|
|
|
70
72
|
|
|
71
73
|
|
|
72
74
|
def initialize_minimal():
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
# initialize(TSessionContext=None, use_holado_logger=False, logging_config_file_path=None,
|
|
76
|
+
# log_level=None, log_on_console=True, log_in_file=False,
|
|
77
|
+
# session_kwargs={'with_session_path':False},
|
|
78
|
+
# garbage_collector_periodicity=None)
|
|
79
|
+
initialize(TSessionContext=None, use_holado_logger=True, logging_config_file_path=None,
|
|
80
|
+
log_level=None, log_on_console=True, log_in_file=False,
|
|
81
|
+
garbage_collector_periodicity=None)
|
|
75
82
|
|
|
76
|
-
def initialize(TSessionContext=None,
|
|
83
|
+
def initialize(TSessionContext=None, use_holado_logger=True, logging_config_file_path=None,
|
|
77
84
|
log_level=None, log_on_console=False, log_in_file=True, session_kwargs=None,
|
|
78
85
|
garbage_collector_periodicity=default_value):
|
|
86
|
+
global __initialized
|
|
87
|
+
if __initialized:
|
|
88
|
+
from holado_core.common.exceptions.technical_exception import TechnicalException
|
|
89
|
+
raise TechnicalException(f"HolAdo was already initialized")
|
|
90
|
+
|
|
79
91
|
from holado_core.common.tools.tools import Tools
|
|
80
92
|
|
|
81
93
|
if session_kwargs is None:
|
|
82
94
|
session_kwargs = {}
|
|
83
95
|
with_session_path = session_kwargs.get("with_session_path", True)
|
|
84
96
|
|
|
97
|
+
# Reset session context before initializing logging
|
|
98
|
+
# Note: Session context must not be created before logging initialization
|
|
99
|
+
from holado.common.context.session_context import SessionContext
|
|
100
|
+
SessionContext._reset_instance()
|
|
85
101
|
if TSessionContext is not None:
|
|
86
102
|
if isinstance(TSessionContext, str):
|
|
87
103
|
module_name, class_type = TSessionContext.rsplit('.', maxsplit=1)
|
|
88
104
|
module = importlib.import_module(module_name)
|
|
89
105
|
TSessionContext = getattr(module, class_type)
|
|
90
|
-
|
|
91
|
-
from holado.common.context.session_context import SessionContext
|
|
106
|
+
|
|
92
107
|
SessionContext.TSessionContext = TSessionContext
|
|
93
108
|
|
|
94
109
|
# Initialize logging
|
|
95
|
-
_initialize_logging(
|
|
110
|
+
_initialize_logging(use_holado_logger=use_holado_logger, logging_config_file_path=logging_config_file_path,
|
|
96
111
|
log_level=log_level, log_on_console=log_on_console, log_in_file=log_in_file and with_session_path)
|
|
97
112
|
if Tools.do_log(logger, logging.DEBUG):
|
|
98
113
|
logger.debug("Configured logging")
|
|
99
114
|
|
|
100
115
|
if Tools.do_log(logger, logging.DEBUG):
|
|
101
116
|
logger.debug("Importing HolAdo modules")
|
|
102
|
-
|
|
117
|
+
_import_modules(get_holado_module_names())
|
|
103
118
|
|
|
104
|
-
|
|
119
|
+
_initialize_session_context(session_kwargs)
|
|
105
120
|
|
|
106
121
|
# Initialize garbage collector
|
|
107
122
|
if garbage_collector_periodicity is not None:
|
|
108
123
|
GcManager.collect_periodically(garbage_collector_periodicity)
|
|
109
124
|
logger.debug(f"Garbage collector is disabled, and collects are automatically done in a dedicated thread (periodicity: {GcManager.get_collect_periodicity()} s)")
|
|
110
125
|
|
|
111
|
-
|
|
126
|
+
if with_behave:
|
|
127
|
+
# Register default behave parameter types
|
|
128
|
+
#TODO: make step tools a service
|
|
129
|
+
from holado_test.behave.scenario.behave_step_tools import BehaveStepTools
|
|
130
|
+
BehaveStepTools.register_default_types()
|
|
131
|
+
|
|
132
|
+
__initialized = True
|
|
133
|
+
|
|
134
|
+
def initialize_for_script(TSessionContext=None, use_holado_logger=True, logging_config_file_path=None,
|
|
135
|
+
log_level=logging.WARNING, log_on_console=True, log_in_file=False, session_kwargs=None,
|
|
136
|
+
garbage_collector_periodicity=None):
|
|
112
137
|
if session_kwargs is None:
|
|
113
138
|
session_kwargs={'with_session_path':log_in_file, 'raise_if_not_exist':False}
|
|
114
139
|
|
|
115
|
-
initialize(TSessionContext=TSessionContext,
|
|
140
|
+
initialize(TSessionContext=TSessionContext, use_holado_logger=use_holado_logger, logging_config_file_path=logging_config_file_path,
|
|
116
141
|
log_level=log_level, log_on_console=log_on_console, log_in_file=log_in_file,
|
|
117
|
-
session_kwargs=session_kwargs
|
|
142
|
+
session_kwargs=session_kwargs,
|
|
143
|
+
garbage_collector_periodicity=garbage_collector_periodicity )
|
|
118
144
|
|
|
119
145
|
|
|
120
|
-
def
|
|
146
|
+
def _initialize_session_context(session_kwargs=None):
|
|
121
147
|
from holado_core.common.tools.tools import Tools
|
|
122
148
|
|
|
123
149
|
if Tools.do_log(logger, logging.DEBUG):
|
|
@@ -130,10 +156,18 @@ def initialize_session_context(session_kwargs=None):
|
|
|
130
156
|
if Tools.do_log(logger, logging.DEBUG):
|
|
131
157
|
logger.debug("Initialized SessionContext")
|
|
132
158
|
|
|
159
|
+
def _is_in_holado_package(here=None):
|
|
160
|
+
if here is None:
|
|
161
|
+
here = os.path.abspath(os.path.dirname(__file__))
|
|
162
|
+
return 'site-packages' in here
|
|
133
163
|
|
|
134
164
|
def get_holado_path():
|
|
135
165
|
here = os.path.abspath(os.path.dirname(__file__))
|
|
136
|
-
|
|
166
|
+
if _is_in_holado_package(here):
|
|
167
|
+
from holado_core.common.exceptions.technical_exception import TechnicalException
|
|
168
|
+
raise TechnicalException(f"When using installed 'holado' package, the project HolAdo is not available")
|
|
169
|
+
else:
|
|
170
|
+
return os.path.normpath(os.path.join(here, "..", ".."))
|
|
137
171
|
|
|
138
172
|
def get_holado_src_path():
|
|
139
173
|
here = os.path.abspath(os.path.dirname(__file__))
|
|
@@ -143,7 +177,7 @@ def get_holado_module_names():
|
|
|
143
177
|
lp = sorted(os.listdir(get_holado_src_path()))
|
|
144
178
|
return [name for name in lp if name.startswith("holado_") and name not in ['holado_logging']]
|
|
145
179
|
|
|
146
|
-
def
|
|
180
|
+
def _import_modules(module_names):
|
|
147
181
|
from holado_core.common.tools.tools import Tools
|
|
148
182
|
|
|
149
183
|
imported_modules = __import_modules(module_names)
|
|
@@ -272,6 +306,8 @@ def print_imported_modules(prefix):
|
|
|
272
306
|
|
|
273
307
|
|
|
274
308
|
# Process minimal initialization of HolAdo
|
|
275
|
-
|
|
309
|
+
# Note: Currently, initialization can be done only once, thus minimal initialization is commented.
|
|
310
|
+
# As a consequence, the call of an initialize method is mandatory
|
|
311
|
+
# initialize_minimal()
|
|
276
312
|
|
|
277
313
|
|
|
@@ -170,13 +170,21 @@ class ServiceManager(object):
|
|
|
170
170
|
return context.get_object(name)
|
|
171
171
|
|
|
172
172
|
def add_context_property(self, name, context_type, raise_if_service_exist=None):
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
# Note: next lines are commented, to allow to set again the service in context type
|
|
174
|
+
# if raise_if_service_exist is None or raise_if_service_exist:
|
|
175
|
+
# self.__verify_service_doesnt_exist(name, context_type, raise_if_service_exist)
|
|
176
|
+
if hasattr(context_type, name):
|
|
177
|
+
logger.debug(f"Set again the property '{name}' in context type {context_type}")
|
|
175
178
|
|
|
176
179
|
@property
|
|
177
180
|
def context_service_property(self_context):
|
|
178
181
|
return self._get_context_service(name, self_context)
|
|
179
182
|
setattr(context_type, name, context_service_property)
|
|
183
|
+
|
|
184
|
+
@property
|
|
185
|
+
def context_has_service_property(self_context):
|
|
186
|
+
return self_context.has_object(name)
|
|
187
|
+
setattr(context_type, 'has_' + name, context_has_service_property)
|
|
180
188
|
|
|
181
189
|
def add_shortcut_property_to_context_service(self, name, dst_type, context_type, raise_if_service_exist=None):
|
|
182
190
|
from holado_multitask.multiprocessing.context.process_context import ProcessContext
|
|
@@ -18,6 +18,7 @@ import os.path
|
|
|
18
18
|
from holado.common.context.context import Context
|
|
19
19
|
from holado_core.common.tools.tools import Tools
|
|
20
20
|
import threading
|
|
21
|
+
from holado.common.handlers.enums import ObjectStates
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
logger = logging
|
|
@@ -32,16 +33,37 @@ class SessionContext(Context):
|
|
|
32
33
|
|
|
33
34
|
# Singleton management
|
|
34
35
|
__instance = None
|
|
36
|
+
__is_resetting_instance = False
|
|
35
37
|
|
|
36
38
|
@staticmethod
|
|
37
39
|
def instance() -> TSessionContext:
|
|
40
|
+
# Note: If session context istance is under reset, consider it is already None
|
|
41
|
+
if SessionContext.__is_resetting_instance:
|
|
42
|
+
return None
|
|
43
|
+
|
|
38
44
|
if SessionContext.__instance is None:
|
|
39
45
|
SessionContext.__instance = SessionContext.TSessionContext()
|
|
40
|
-
|
|
46
|
+
logger.debug(f"Created session context of type {SessionContext.TSessionContext}")
|
|
47
|
+
# logging.log(45, f"Created session context of type {SessionContext.TSessionContext}")
|
|
41
48
|
# import traceback
|
|
42
|
-
#
|
|
49
|
+
# logging.log(45, "".join(traceback.format_list(traceback.extract_stack())))
|
|
43
50
|
return SessionContext.__instance
|
|
44
51
|
|
|
52
|
+
@staticmethod
|
|
53
|
+
def has_instance() -> bool:
|
|
54
|
+
if SessionContext.__is_resetting_instance:
|
|
55
|
+
return False
|
|
56
|
+
else:
|
|
57
|
+
return SessionContext.__instance is not None
|
|
58
|
+
|
|
59
|
+
@staticmethod
|
|
60
|
+
def _reset_instance():
|
|
61
|
+
if SessionContext.__instance is not None:
|
|
62
|
+
logger.debug(f"Resetting session context")
|
|
63
|
+
SessionContext.__is_resetting_instance = True
|
|
64
|
+
SessionContext.__instance = None
|
|
65
|
+
SessionContext.__is_resetting_instance = False
|
|
66
|
+
logger.debug(f"Reset of session context")
|
|
45
67
|
|
|
46
68
|
def __init__(self, name="Session"):
|
|
47
69
|
super().__init__(name)
|
|
@@ -55,12 +77,27 @@ class SessionContext(Context):
|
|
|
55
77
|
self.__multitask_lock = threading.RLock()
|
|
56
78
|
self.__multitask_step_lock = threading.RLock()
|
|
57
79
|
|
|
80
|
+
def __del__(self):
|
|
81
|
+
# Note: Override Object.__del__ since it supposes that SessionContext is initialized, whereas SessionContext is deleting
|
|
82
|
+
try:
|
|
83
|
+
if self.object_state in [ObjectStates.Deleting, ObjectStates.Deleted]:
|
|
84
|
+
return
|
|
85
|
+
|
|
86
|
+
self.delete_object()
|
|
87
|
+
except Exception as exc:
|
|
88
|
+
if "Python is likely shutting down" in str(exc):
|
|
89
|
+
# Simply return
|
|
90
|
+
return
|
|
91
|
+
else:
|
|
92
|
+
raise exc
|
|
93
|
+
|
|
58
94
|
def _delete_object(self):
|
|
59
|
-
logger.info(f"Delete session context - Interrupting and unregistering all threads...")
|
|
60
95
|
# if Tools.do_log(logger, logging.DEBUG):
|
|
61
96
|
# logger.debug("Interrupting and unregistering all threads for scenario [{}]".format(scenario.name))
|
|
62
|
-
self.
|
|
63
|
-
|
|
97
|
+
if self.has_threads_manager:
|
|
98
|
+
logger.info(f"Delete session context - Interrupting and unregistering all threads...")
|
|
99
|
+
self.threads_manager.interrupt_all_threads(scope="Session")
|
|
100
|
+
self.threads_manager.unregister_all_threads(scope="Session", keep_alive=False)
|
|
64
101
|
|
|
65
102
|
# Delete session context
|
|
66
103
|
logger.info(f"Delete session context - Deleting context objects...")
|
|
@@ -76,11 +113,6 @@ class SessionContext(Context):
|
|
|
76
113
|
|
|
77
114
|
self.__with_session_path = session_kwargs.get("with_session_path", True)
|
|
78
115
|
|
|
79
|
-
# Register default behave parameter types
|
|
80
|
-
#TODO: make step tools a service
|
|
81
|
-
from holado_test.behave.scenario.behave_step_tools import BehaveStepTools
|
|
82
|
-
BehaveStepTools.register_default_types()
|
|
83
|
-
|
|
84
116
|
# Create this thread context
|
|
85
117
|
self.multitask_manager.get_thread_context()
|
|
86
118
|
|
|
@@ -122,14 +154,13 @@ class SessionContext(Context):
|
|
|
122
154
|
name = "session_{}".format(datetime.now().strftime("%Y-%m-%d_%H-%M-%S"))
|
|
123
155
|
report_path = self.path_manager.get_reports_path(name)
|
|
124
156
|
logger.info(f"Reports location: {report_path}")
|
|
125
|
-
|
|
157
|
+
print(f"Reports location: {report_path}")
|
|
126
158
|
self.report_manager.new_session(report_path)
|
|
127
159
|
|
|
128
160
|
# Logging configuration
|
|
129
161
|
if self.with_session_path and SessionContext.instance().log_manager.in_file:
|
|
130
162
|
log_filename = os.path.join(report_path, "logs", "report.log")
|
|
131
163
|
self.path_manager.makedirs(log_filename)
|
|
132
|
-
SessionContext.instance().log_manager.on_console = False
|
|
133
164
|
SessionContext.instance().log_manager.set_root_log_file(log_filename)
|
|
134
165
|
SessionContext.instance().log_manager.set_config()
|
|
135
166
|
|
holado/common/handlers/object.py
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
from builtins import object
|
|
15
15
|
import logging
|
|
16
16
|
from holado.common.handlers.enums import ObjectStates
|
|
17
|
-
from holado.common.tools.gc_manager import GcManager
|
|
18
17
|
|
|
19
18
|
logger = None
|
|
20
19
|
|
|
@@ -66,15 +65,24 @@ class DeleteableObject(Object):
|
|
|
66
65
|
|
|
67
66
|
def __del__(self):
|
|
68
67
|
try:
|
|
69
|
-
from holado_multitask.multithreading.functionthreaded import FunctionThreaded
|
|
70
|
-
|
|
71
68
|
if self.object_state in [ObjectStates.Deleting, ObjectStates.Deleted]:
|
|
72
69
|
return
|
|
73
70
|
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
if logger.isEnabledFor(logging.DEBUG):
|
|
72
|
+
logger.debug(f"Deleting object of ID {id(self)} and type {type(self)}")
|
|
73
|
+
if logger.isEnabledFor(logging.TRACE): # @UndefinedVariable
|
|
74
|
+
import traceback
|
|
75
|
+
logger.trace("".join(traceback.format_list(traceback.extract_stack())))
|
|
76
|
+
|
|
77
|
+
# Notes:
|
|
78
|
+
# - Garbage collector default mecanism is incompatible with custom object finalizers (cf GcManager.Method __del__ is called by garbage collector. This call can be done in any thread at any moment.
|
|
79
|
+
# - When SessionContext is under deletion, delete any object by thread is not possible
|
|
80
|
+
from holado.common.context.session_context import SessionContext
|
|
81
|
+
from holado.common.tools.gc_manager import GcManager
|
|
82
|
+
if GcManager.is_collect_threaded() or isinstance(self, SessionContext.TSessionContext) or not SessionContext.has_instance():
|
|
76
83
|
self.__delete()
|
|
77
84
|
else:
|
|
85
|
+
from holado_multitask.multithreading.functionthreaded import FunctionThreaded
|
|
78
86
|
func = FunctionThreaded(self.__delete, name=f"delete object '{self.name}'", register_thread=False)
|
|
79
87
|
func.start()
|
|
80
88
|
func.join(timeout=30, raise_if_still_alive=False) # timeout of 30s to limit deadlock impact ; raise to False since exceptions are omitted in gc collect context
|
|
@@ -128,6 +136,7 @@ class DeleteableObject(Object):
|
|
|
128
136
|
|
|
129
137
|
# Call garbage collector
|
|
130
138
|
if self.__on_delete_gc_collect:
|
|
139
|
+
from holado.common.tools.gc_manager import GcManager
|
|
131
140
|
GcManager.collect()
|
|
132
141
|
|
|
133
142
|
self.object_state = ObjectStates.Deleted
|
|
@@ -11,13 +11,21 @@
|
|
|
11
11
|
#################################################
|
|
12
12
|
|
|
13
13
|
import logging
|
|
14
|
+
from holado.common.handlers.object import Object
|
|
14
15
|
|
|
15
16
|
logger = logging.getLogger(__name__)
|
|
16
17
|
|
|
17
18
|
|
|
18
|
-
class Undefined(
|
|
19
|
-
def __init__(self, undefined_value=0):
|
|
19
|
+
class Undefined(Object):
|
|
20
|
+
def __init__(self, name, undefined_value=0):
|
|
21
|
+
super().__init__(name)
|
|
20
22
|
self.__value = undefined_value
|
|
23
|
+
|
|
24
|
+
def __str__(self)->str:
|
|
25
|
+
if self.name is not None:
|
|
26
|
+
return f"<{self.name}>"
|
|
27
|
+
else:
|
|
28
|
+
return super().__str__()
|
|
21
29
|
|
|
22
30
|
def is_undefined(obj):
|
|
23
31
|
return isinstance(obj, Undefined)
|
|
@@ -25,15 +33,17 @@ def is_undefined(obj):
|
|
|
25
33
|
|
|
26
34
|
# Define specific undefined objects
|
|
27
35
|
|
|
28
|
-
undefined_argument = Undefined(0)
|
|
29
|
-
undefined_value = Undefined(1)
|
|
36
|
+
undefined_argument = Undefined("Undefined argument", 0)
|
|
37
|
+
undefined_value = Undefined("Undefined value", 1)
|
|
38
|
+
not_applicable = Undefined("Not Applicable", 2)
|
|
39
|
+
to_be_defined = Undefined("To be defined", 3) # Usage: initial variable value defining it is to be defined. It is useful when undefined_value can be a possible value.
|
|
30
40
|
|
|
31
41
|
|
|
32
42
|
|
|
33
43
|
# Define specific default values
|
|
34
44
|
# Note: Real value is defined by methods managing these values as argument.
|
|
35
45
|
|
|
36
|
-
default_value = Undefined(
|
|
37
|
-
default_context = Undefined(
|
|
46
|
+
default_value = Undefined("Default value", 10)
|
|
47
|
+
default_context = Undefined("Defautl context", 11) # Example of real value: for ThreadsManager it means "current ScenarioContext" if a scenario context exists else "SessionContext".
|
|
38
48
|
|
|
39
49
|
|
holado/holado_config.py
CHANGED
|
@@ -16,6 +16,7 @@ class Config(object):
|
|
|
16
16
|
"""HolAdo project configuration"""
|
|
17
17
|
|
|
18
18
|
# Timeouts
|
|
19
|
+
session_timeout_seconds = 7 * 24 * 3600 # Session timeout is by default to 7 days
|
|
19
20
|
timeout_seconds = 240 # Default timeout
|
|
20
21
|
join_timeout_seconds = 1800 # Long timeout used when a join should stop without deadlock. When this timeout is reached, a TimeoutTechnicalException is raised
|
|
21
22
|
|