holado 0.2.5__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 +9 -1
- holado/common/handlers/object.py +2 -1
- holado/common/handlers/undefined.py +16 -6
- {holado-0.2.5.dist-info → holado-0.2.6.dist-info}/METADATA +1 -1
- {holado-0.2.5.dist-info → holado-0.2.6.dist-info}/RECORD +31 -30
- 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/tools.py +24 -7
- holado_helper/initialize_holado.py +72 -0
- holado_helper/script/action.py +21 -9
- holado_helper/script/initialize_script.py +3 -23
- holado_helper/script/script.py +2 -2
- 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/scenario/step_tools.py +11 -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/features/NonReg/{ipc → holado_binary}/bit_series.feature +13 -0
- test_holado/features/NonReg/test_steps/common.feature +1 -1
- {holado-0.2.5.dist-info → holado-0.2.6.dist-info}/WHEEL +0 -0
- {holado-0.2.5.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
|
@@ -156,10 +156,18 @@ def _initialize_session_context(session_kwargs=None):
|
|
|
156
156
|
if Tools.do_log(logger, logging.DEBUG):
|
|
157
157
|
logger.debug("Initialized SessionContext")
|
|
158
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
|
|
159
163
|
|
|
160
164
|
def get_holado_path():
|
|
161
165
|
here = os.path.abspath(os.path.dirname(__file__))
|
|
162
|
-
|
|
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, "..", ".."))
|
|
163
171
|
|
|
164
172
|
def get_holado_src_path():
|
|
165
173
|
here = os.path.abspath(os.path.dirname(__file__))
|
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
|
|
|
@@ -79,6 +78,7 @@ class DeleteableObject(Object):
|
|
|
79
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.
|
|
80
79
|
# - When SessionContext is under deletion, delete any object by thread is not possible
|
|
81
80
|
from holado.common.context.session_context import SessionContext
|
|
81
|
+
from holado.common.tools.gc_manager import GcManager
|
|
82
82
|
if GcManager.is_collect_threaded() or isinstance(self, SessionContext.TSessionContext) or not SessionContext.has_instance():
|
|
83
83
|
self.__delete()
|
|
84
84
|
else:
|
|
@@ -136,6 +136,7 @@ class DeleteableObject(Object):
|
|
|
136
136
|
|
|
137
137
|
# Call garbage collector
|
|
138
138
|
if self.__on_delete_gc_collect:
|
|
139
|
+
from holado.common.tools.gc_manager import GcManager
|
|
139
140
|
GcManager.collect()
|
|
140
141
|
|
|
141
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
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
holado/__init__.py,sha256=
|
|
1
|
+
holado/__init__.py,sha256=nlZ_b8wSbfv7I4ox2Ul3JcQa8JrDshQ05BTIGpnFM3E,14858
|
|
2
2
|
holado/holado_config.py,sha256=-HPwBdEcdG1kLfqSq4bH_esXbndVkNX4WW0VSpqoxu4,2459
|
|
3
3
|
holado/common/__init__.py,sha256=ZjXM-FRQgnfzRNXqcvJOGewDHVRR-U5-ugStSs8U2Xs,1525
|
|
4
4
|
holado/common/context/__init__.py,sha256=3jJBLm8myrYF9jbdV1EhIA6BtnlmjX33eeoDpTzwmLA,1604
|
|
@@ -7,8 +7,8 @@ holado/common/context/service_manager.py,sha256=LaCn8ukE1aqJynmwoexAYj5hCkdb_F3h
|
|
|
7
7
|
holado/common/context/session_context.py,sha256=jyCXydCk7RnTf35MFcqaEflOsjX5eK2U33uITeGqP6U,22477
|
|
8
8
|
holado/common/handlers/__init__.py,sha256=d0KDUpaAAw1eBXyX08gaRh4RECnJlXjYQ0TcU-Ndicc,1372
|
|
9
9
|
holado/common/handlers/enums.py,sha256=ieqKVoukEiNyfE3KrKmMOImdbFS1ocUMud8JHe2xNLs,1662
|
|
10
|
-
holado/common/handlers/object.py,sha256
|
|
11
|
-
holado/common/handlers/undefined.py,sha256=
|
|
10
|
+
holado/common/handlers/object.py,sha256=-KL3HgNpQq5iOrztLEUgJJEjhgcnnpaV20GAQNSCMSw,6446
|
|
11
|
+
holado/common/handlers/undefined.py,sha256=hZDKEljK5YO3Kq1uoQJSyZ9-AjYPdSnu7Ty7DoVEnBw,2407
|
|
12
12
|
holado/common/tools/__init__.py,sha256=z-T6zX_tOVkJjniTDA0KSKmdtosjfEhjaNa1-3g8wTs,1374
|
|
13
13
|
holado/common/tools/gc_manager.py,sha256=TjQg7MisGRhxuiQ22hB3IuqNhnWCVEWpU253-rOjR0w,7611
|
|
14
14
|
holado_ais/__init__.py,sha256=Mudcgu_7p1hBDBs6LpSz757H4haB0yLHgT70sznG82c,1807
|
|
@@ -47,7 +47,7 @@ holado_core/common/block/block_steps.py,sha256=xHjj2loNoKmBNNdKIM7GC5VVn86rHNgxs
|
|
|
47
47
|
holado_core/common/block/function.py,sha256=1b2mEpsOY-8PfJV56tsMhczEvoY5g2VjoK_wiT42mKY,2074
|
|
48
48
|
holado_core/common/block/scope_function.py,sha256=tFSp2A_P_z5N2Av2TiD6J7VgfNex0Xcg2Gl3V-npTvQ,1531
|
|
49
49
|
holado_core/common/block/scope_manager.py,sha256=3rvHgl62mAF2onLjDdxBxuA2xq809yMnzcOXUU5sqQ0,12345
|
|
50
|
-
holado_core/common/block/scope_steps.py,sha256=
|
|
50
|
+
holado_core/common/block/scope_steps.py,sha256=zjwLvqAFM0gbpjOg61MlUvEW9OPuj7VoWWAjJqhqn2Q,6800
|
|
51
51
|
holado_core/common/criterias/and_criteria.py,sha256=xqSILJhbMRMiqLU8agIz_X6CZp9ZUl1iFaj7upyhmXU,2787
|
|
52
52
|
holado_core/common/criterias/criteria.py,sha256=FThlwHKjjbLKsiPTncesmN0-MRq5ZJyvjISK5aWqnig,3941
|
|
53
53
|
holado_core/common/criterias/or_criteria.py,sha256=Y89d9AMoBFLwnQSkVZhFIlm2En9Rbf4l6oAQtf-L7CQ,2851
|
|
@@ -98,7 +98,7 @@ holado_core/common/inspectors/tools/inspect_builder.py,sha256=v7azgwciXHtO-o7gcg
|
|
|
98
98
|
holado_core/common/inspectors/tools/inspect_context.py,sha256=lzhhO5HxG00c6uMPyIXEUz0FHA61VCNUZr_39ykZ8lQ,2700
|
|
99
99
|
holado_core/common/inspectors/tools/inspect_parameters.py,sha256=2vXUpnZlP2cCYTvI9ddI6NGhONideoM1hBJ0vGdvPKo,7346
|
|
100
100
|
holado_core/common/resource/persisted_data_manager.py,sha256=Zyxj99tKmL3cN_Bun44JNrlXOD4sjGPAhkHj2JcZPKc,5914
|
|
101
|
-
holado_core/common/resource/persisted_method_to_call_manager.py,sha256=
|
|
101
|
+
holado_core/common/resource/persisted_method_to_call_manager.py,sha256=o5aXDK70pnr6WiWmyVN3EzhEllRiyO92ftlU2ukBgYo,6866
|
|
102
102
|
holado_core/common/resource/resource_manager.py,sha256=3UmKaZGfCGJUJ9EvwHibuf6ILANshl6zVK6CkGDrtwo,7182
|
|
103
103
|
holado_core/common/tables/__init__.py,sha256=i2-gExPOUa_AnmEPgZJQ2lAXeK02PLpPnjEqbsgj1Co,8
|
|
104
104
|
holado_core/common/tables/enums.py,sha256=YtYTSI1m6KQ3XFzOSFPi5De6Jc-nkDMTbnmqfRfsiJ0,1395
|
|
@@ -127,7 +127,7 @@ holado_core/common/tables/converters/table_converter.py,sha256=lFt1NKFo5aMPMpKQi
|
|
|
127
127
|
holado_core/common/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
128
128
|
holado_core/common/tools/path_manager.py,sha256=dgdm8wAaVubh-krpquCXXeGUTtGqRKDpuEKmvhA9dKA,8899
|
|
129
129
|
holado_core/common/tools/string_tools.py,sha256=j6ErNwpz19AXmbuvMk1HakX0EXfOkgu3s6bVohdz1g8,5365
|
|
130
|
-
holado_core/common/tools/tools.py,sha256=
|
|
130
|
+
holado_core/common/tools/tools.py,sha256=G0q3bk9lOVRAHuOhs5PZT_5DEpRcmNhNmZuFqsMy6yw,9023
|
|
131
131
|
holado_core/common/tools/comparators/comparator.py,sha256=K4LcXIRORHX5vkmDibI6P6Bu1L-6Xezb63ZzzOMKrWY,6812
|
|
132
132
|
holado_core/common/tools/comparators/object_comparator.py,sha256=RPI319h_tij6z75UVbZII3gBggQolRFMNMD4cN6z37Y,1399
|
|
133
133
|
holado_core/common/tools/converters/converter.py,sha256=8XBzapzxQRX-ciFdNtkhK75Q1ZhJUbfdaOhGCCfZmNk,3639
|
|
@@ -185,6 +185,7 @@ holado_grpc/tests/behave/steps/api/grpc_client_steps.py,sha256=GtCO1S9C1qBle8z47
|
|
|
185
185
|
holado_grpc/tests/behave/steps/private/__init__.py,sha256=CWs_e6XSEnr9Y_kF3PxF3esA0EeRNnsqp4PEN8gBxrI,1276
|
|
186
186
|
holado_grpc/tests/behave/steps/private/api/grpc_steps.py,sha256=7XqackVsNy-ceX-WpjUCkM0wmfhCG9vpBO0R4obC030,3922
|
|
187
187
|
holado_helper/__init__.py,sha256=U5rV9zTT4OFE4MU2yiOIDlAmwQ_NO2CB0Adih2sn8eQ,1780
|
|
188
|
+
holado_helper/initialize_holado.py,sha256=UxNphXyjs-xraorzMWjDe6-QYw_Q3mtykyY-ENYZB1o,3464
|
|
188
189
|
holado_helper/debug/README.txt,sha256=kpsK1Ii5-t5pJCL9ChcEbZYyYTKt34fjKdiMC5DGOjc,2045
|
|
189
190
|
holado_helper/debug/memory/memory_profiler.py,sha256=Qu05N3uzntqm5S5XJMPdG9X0EFdagZS5poNQJPgZ-Iw,4659
|
|
190
191
|
holado_helper/docker/init_user.sh,sha256=vac-OUgsbSTIuO7MK4mpbtRZNGqHbNJGNm3Hk3W3FWQ,913
|
|
@@ -195,16 +196,16 @@ holado_helper/docker/run_terminal_in_docker.sh,sha256=GOOhbo9cEjw5Pp5BlhbzZm2U5X
|
|
|
195
196
|
holado_helper/holado_module_template/__init__.py,sha256=KpbIi2cm1BYZgoWf0LuhE0ei3ZCE15UcUtjC1cSA55M,1653
|
|
196
197
|
holado_helper/holado_module_template/test/behave/steps/__init__.py,sha256=BHp8TYE_X4lWn4B8A51nXSYaJlczuiDVJLcKMy7p0Lw,1267
|
|
197
198
|
holado_helper/holado_module_template/test/behave/steps/private/__init__.py,sha256=BHp8TYE_X4lWn4B8A51nXSYaJlczuiDVJLcKMy7p0Lw,1267
|
|
198
|
-
holado_helper/script/action.py,sha256=
|
|
199
|
+
holado_helper/script/action.py,sha256=e2RFH2krmNMB3MLTIHukJcAZH6zNgxTJlJJmkW-ifFI,5800
|
|
199
200
|
holado_helper/script/action_script.py,sha256=6yhb7M9aGe6jbqA4APa2rc3zC3INXvNTZjpGXDWMBug,22543
|
|
200
201
|
holado_helper/script/any_action_script.py,sha256=6P1bG3UoSO0JVS6kWaDGd4jP7MN-foiThRcVitW3Hjg,7901
|
|
201
202
|
holado_helper/script/behave_action_script.py,sha256=DwIRdHrRBM9qcLxoSx0vtyy3RX308g8bRlLT-UAqimM,5148
|
|
202
203
|
holado_helper/script/csv_action_script.py,sha256=mNoy9AS99uh57GCh5BPmxlp-hVql7S-ZPAQD_Kit3gA,7259
|
|
203
|
-
holado_helper/script/initialize_script.py,sha256=
|
|
204
|
+
holado_helper/script/initialize_script.py,sha256=Te6rQlEjuwnT2lGJLdPIuzzyJD_tTFqAznYhENjuBQY,4367
|
|
204
205
|
holado_helper/script/input_output_script.py,sha256=sRldfxO58KCjr5Zh_i-3MXy8zPPWDnNzZDLiwTKuBdM,6039
|
|
205
206
|
holado_helper/script/job.py,sha256=hb7WenhQP1qFMsxWGMsgbA-Z-zixynjRWjmZdx9wHEI,4435
|
|
206
207
|
holado_helper/script/json_action_script.py,sha256=angdSt6e385lKwYSGJBqytVb4sp3-HjMKziVEFSz6ro,5147
|
|
207
|
-
holado_helper/script/script.py,sha256=
|
|
208
|
+
holado_helper/script/script.py,sha256=77LRYUWiNwiXRDGiwlKqZJ40-lKD40dtR31w1bQW178,4494
|
|
208
209
|
holado_json/__init__.py,sha256=z0SNFOdBBWUouC12WKDmL18T_OH3TdmfcgIbnNQzbjU,1247
|
|
209
210
|
holado_json/ipc/json.py,sha256=MuMBa_KrDdIXtikl6CF84jMfBXmRHQRwVmIdRbQ3ejI,6203
|
|
210
211
|
holado_json/ipc/json_converter.py,sha256=i4sPg9jZ2EziW8L6K-Rlm5-ubweFIWHq2R19avmsjkM,3433
|
|
@@ -247,7 +248,7 @@ holado_protobuf/__init__.py,sha256=PsfsVCEC663IoDbDGyAjRUnOzXXSammPd9MH4nkOp28,3
|
|
|
247
248
|
holado_protobuf/ipc/protobuf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
248
249
|
holado_protobuf/ipc/protobuf/protobuf_compiler.py,sha256=RIHyjsLpgv6jwsIz4hXUStTnn_TGwFL3LOgrzxKhEOw,6349
|
|
249
250
|
holado_protobuf/ipc/protobuf/protobuf_converter.py,sha256=L3SAhBC3L5ghcXFD9Q9nHodPb3aP4bBd6nB7k9soHJ4,8995
|
|
250
|
-
holado_protobuf/ipc/protobuf/protobuf_messages.py,sha256=
|
|
251
|
+
holado_protobuf/ipc/protobuf/protobuf_messages.py,sha256=SJY3yAB5JLN1GD8-_80XJXCl9lNTQUSAIAdh-Wv45TA,61765
|
|
251
252
|
holado_protobuf/ipc/protobuf/protobuf_modifier.py,sha256=TZUfUYJd2nPoDYw3GXaGy5GLp7YwG-bqJFZ6Ep1mNLQ,3271
|
|
252
253
|
holado_protobuf/ipc/protobuf/abstracts/type.py,sha256=xr6CvHTJJQBDKtpPdOlUJyWjdjbHsm5uPHa3eOZlvLQ,2234
|
|
253
254
|
holado_protobuf/ipc/protobuf/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -343,8 +344,8 @@ holado_s3/tools/s3/minio_client.py,sha256=B_Ie2fNIqyJE5vXO4iQw3Tg5yk8k-yGBuJtaf4
|
|
|
343
344
|
holado_s3/tools/s3/moto_server.py,sha256=zft4KgYIFbJot0JyQJCAwEcbGDJIKinqOUIKRuSrSHE,2493
|
|
344
345
|
holado_scripting/__init__.py,sha256=wsTcscy-q0EoQq2Hmf1KbEejIez2UUfLp3TdQHMVWlc,3744
|
|
345
346
|
holado_scripting/common/tools/dynamic_text_manager.py,sha256=dR9DGVj4nb_icFlnLB3jRQu8DDwTuC3tX46BDyi9xec,3332
|
|
346
|
-
holado_scripting/common/tools/evaluate_parameters.py,sha256=
|
|
347
|
-
holado_scripting/common/tools/expression_evaluator.py,sha256=
|
|
347
|
+
holado_scripting/common/tools/evaluate_parameters.py,sha256=zru4_vwqIx_KxWVG_luOcmr-0ywjmY7aaEN4TCvCjb4,10405
|
|
348
|
+
holado_scripting/common/tools/expression_evaluator.py,sha256=pig2dNisHTuRnLh7vR6ciwn0o8rnDvVOQKT44iF0QB4,24309
|
|
348
349
|
holado_scripting/common/tools/variable_manager.py,sha256=VGJH_OYPduTCSA_CLMpZUiC_nqAJJtGWZ2mwPEGzpW8,15672
|
|
349
350
|
holado_scripting/tests/behave/steps/__init__.py,sha256=GSug7OdldGvwbSuJOuLQVIZ8qU4bsfdvTY6VzSnMbTE,1544
|
|
350
351
|
holado_scripting/tests/behave/steps/common/tools/variable_convert_steps.py,sha256=2tOzgggZMlZR-6IAk7H4XEuKOBkmA93wNvnhxfvd5R4,7837
|
|
@@ -352,19 +353,19 @@ holado_scripting/tests/behave/steps/common/tools/variable_new_steps.py,sha256=rg
|
|
|
352
353
|
holado_scripting/tests/behave/steps/common/tools/variable_steps.py,sha256=NCTGD9YUVamhA1jRy8NzNUIfO5DhAvqAoSRW6z0XJoQ,4947
|
|
353
354
|
holado_scripting/tests/behave/steps/common/tools/variable_verify_steps.py,sha256=NQaqJKOoAt1NVGJ4MXL0akXfL5IP-xeGl-B0yVUk3Uc,7918
|
|
354
355
|
holado_scripting/tests/behave/steps/scenario/function_steps.py,sha256=tVsBWy5yvSv8tUyz67v_jmXVP68Ik67Vf2u3IKnjudo,3424
|
|
355
|
-
holado_scripting/tests/behave/steps/scenario/if_steps.py,sha256=
|
|
356
|
+
holado_scripting/tests/behave/steps/scenario/if_steps.py,sha256=aIbAgImaqwCxZT0sAIvSkdRAUI3OlZz3RkJPbOlshq8,4465
|
|
356
357
|
holado_scripting/tests/behave/steps/scenario/loop_steps.py,sha256=2D7knm_i8XzUujgvauYlmL9pMq13MptHz_aBTeuoMIE,5610
|
|
357
358
|
holado_scripting/text/base/base_function.py,sha256=GX-xVt5dhPQipRkgJ5J9Un-0GhK1NOt_fMOrcs_THB8,1469
|
|
358
359
|
holado_scripting/text/base/base_verify_function.py,sha256=7ivJ-Om9o5KB1pBoh4MU5UZYb40msHvnuEdgKK7EWdg,1494
|
|
359
360
|
holado_scripting/text/base/text_inspecter.py,sha256=Hw7aU7vShmVRwPFcChhrm9rbTYHeUzokPTbUSxXGDJg,8981
|
|
360
|
-
holado_scripting/text/interpreter/text_interpreter.py,sha256=
|
|
361
|
+
holado_scripting/text/interpreter/text_interpreter.py,sha256=KSz8VvTwdFJ6e9YYTwfgWSbK8P_twb4PKYgJHVm21y8,12215
|
|
361
362
|
holado_scripting/text/interpreter/exceptions/interpreter_exception.py,sha256=hvfe1gExRlvsNLfUCghKJwYBdsjVFzqquBhx3J3aFTg,1611
|
|
362
363
|
holado_scripting/text/interpreter/functions/function_cast.py,sha256=EvOWrb949y6rqbf7gHnX-sId3gVmE1eduYWAq58tdg0,3033
|
|
363
364
|
holado_scripting/text/interpreter/functions/function_convert.py,sha256=a2dYdKcMTKEQFr_ZbowTDcGYlMHB_0hGrAry0OKmfz8,2949
|
|
364
365
|
holado_scripting/text/interpreter/functions/function_dynamic_value.py,sha256=zBnIsSWwYgXeiYsAYzjUds6V2ab85jDKUgE90JqKxsY,2230
|
|
365
366
|
holado_scripting/text/interpreter/functions/function_escape_all_bytes.py,sha256=nqvvdgyddz_hd5Wrb3ibAd2dQW6-Uehm4wUbnAnrVDE,2104
|
|
366
367
|
holado_scripting/text/interpreter/functions/function_exists_variable.py,sha256=akVRF-I4E1OXk7LBtowsua5hlRN4jea86c8B4ibb_Qc,2057
|
|
367
|
-
holado_scripting/text/interpreter/functions/function_hex_to_bytes.py,sha256=
|
|
368
|
+
holado_scripting/text/interpreter/functions/function_hex_to_bytes.py,sha256=gBQc7qn_R2e_8Gl9K_yw63KT8BnhM7-Mn_Vr1GcgJL8,2700
|
|
368
369
|
holado_scripting/text/interpreter/functions/function_hex_to_int.py,sha256=LJQvYn9cEzPT5nJBTODwFIjgM5bsi_MhVeoB5UGBlSQ,2738
|
|
369
370
|
holado_scripting/text/interpreter/functions/function_to_base_64.py,sha256=BfOmPN8xNUZl2uBjGWdKwy0oHuYWlhg7ws4_CK514g0,2197
|
|
370
371
|
holado_scripting/text/interpreter/functions/function_to_bytes.py,sha256=EIEgzNKd5YC5uHf5VVFIsW4MVuLsgll9PwKBGSp9b7E,2577
|
|
@@ -401,7 +402,7 @@ holado_test/__init__.py,sha256=A0edMOLhnuU-A_NazQ50WghvKvB889KNCBddtBPa9Ag,1539
|
|
|
401
402
|
holado_test/test_config.py,sha256=yQK2jNHEGltGc3fmsAgcsKN4y3_nuldZHD45XEMrsQA,1575
|
|
402
403
|
holado_test/behave/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
403
404
|
holado_test/behave/behave.py,sha256=IiqT_F45C-xVY2T8sKDPV7NsFCiGNzb8xpoTaXD-PXg,17708
|
|
404
|
-
holado_test/behave/behave_environment.py,sha256=
|
|
405
|
+
holado_test/behave/behave_environment.py,sha256=nwnK2cWwZS3lz-yXhhwuJxKU1aKiTgHbhAzKwIymqng,6575
|
|
405
406
|
holado_test/behave/behave_function.py,sha256=2jDZIIijgQegWHmuzX1DlqRzs4utGjK1OeoucSeCTdg,1691
|
|
406
407
|
holado_test/behave/behave_manager.py,sha256=TEAfPgBQQONFn_l0s7gm7gDgWU0EejvuaPuFApoY_jY,26965
|
|
407
408
|
holado_test/behave/independant_runner.py,sha256=QR_IS-qkK_x2FTryb2gRQrqyBU3YUgKqsaIL2xwXPNQ,3189
|
|
@@ -411,26 +412,26 @@ holado_test/common/context/feature_context.py,sha256=GhC0lihnvTBhv5tE4JzPt39eP7g
|
|
|
411
412
|
holado_test/common/context/scenario_context.py,sha256=pmo-xGtn6oHtbTmcH6Vtp8Dj2iGrYVdHd0b6smtlhbY,10527
|
|
412
413
|
holado_test/common/context/step_context.py,sha256=j6S4ozTPrdlpV9Slopc998fYOV8KfMLAUSW4mcEFUI8,2383
|
|
413
414
|
holado_test/common/exceptions/undefined_step_exception.py,sha256=SHHX22iz4Ip-V4Y3aM2EJFDt30CCS5EaauN6KB-JORo,1461
|
|
414
|
-
holado_test/scenario/step_tools.py,sha256=
|
|
415
|
-
holado_test/scenario/tester_tools.py,sha256=
|
|
415
|
+
holado_test/scenario/step_tools.py,sha256=GvxhVyGAeNZ9gz-24AIVnhJh6fFRQ2uHDZTGWQGCrA8,25463
|
|
416
|
+
holado_test/scenario/tester_tools.py,sha256=GB2AV_T1lluiNZtt5_cAhstEenhIeHC48x-hkK337Uk,2369
|
|
416
417
|
holado_test/tests/behave/steps/__init__.py,sha256=rdqrp-UN7vRplIqORx4sXyKwMUkptRizyLWudsmYehM,1362
|
|
417
418
|
holado_test/tests/behave/steps/scenario/exception_steps.py,sha256=ayMUmIJI4a7w95RL2NYiBWA8jSBwKyjdaRJL3IKdYQ0,4033
|
|
418
419
|
holado_test/tests/behave/steps/scenario/scenario_steps.py,sha256=TPLpatwXrY_Dd71VxzrABs9L2pxNgdMAgSRckjEaC1I,3976
|
|
419
420
|
holado_test/tests/behave/steps/scenario/tester_steps.py,sha256=4mJA6CjyHvQmRv7P_bt8k6SrTr_zrc4AetuSB35Wsow,2896
|
|
420
421
|
holado_value/__init__.py,sha256=60VyLyWux76dFwn03uH4Fz3R6itf6fqKu0pQUdvwblU,1561
|
|
421
422
|
holado_value/common/tables/value_table.py,sha256=fJgb-HWdlMwHOAx5CS38sPiVrjGelEiQBbG9HuHqe-A,1726
|
|
422
|
-
holado_value/common/tables/value_table_cell.py,sha256=
|
|
423
|
+
holado_value/common/tables/value_table_cell.py,sha256=3W2AoDxpvcqH4_Ta4LxeZeaCLa9umhoYrtJtMmSWGFU,3139
|
|
423
424
|
holado_value/common/tables/value_table_manager.py,sha256=1Q7V9RQyJrI5V7GfVcAn2MC_EZ494WeTgO7XvB7wtq8,3000
|
|
424
425
|
holado_value/common/tables/value_table_row.py,sha256=8sX4qPyfoPCe1BvnwnlUyya2iKIr-K733erO9E9AnBc,2539
|
|
425
426
|
holado_value/common/tables/value_table_with_header.py,sha256=6uHR05tUD_EmPz-Qv8ul3kmQ55VjFKIj2G6jGkjXZyU,1763
|
|
426
|
-
holado_value/common/tables/comparators/table_2_value_table_cell_comparator.py,sha256=
|
|
427
|
+
holado_value/common/tables/comparators/table_2_value_table_cell_comparator.py,sha256=tCpamn0-95ggDbJ3NRBWP1Jv8kIU0ZzHQvZo0T0NHxo,10376
|
|
427
428
|
holado_value/common/tables/comparators/table_2_value_table_comparator.py,sha256=rITxTgXami05plxk1qaCVqDcwZaKWoXpKAzur4ingTE,1807
|
|
428
429
|
holado_value/common/tables/comparators/table_2_value_table_row_comparator.py,sha256=_VglWUQWspG1Fo2iAo41auCwWYR24q0TniFck99BF_E,1752
|
|
429
430
|
holado_value/common/tables/comparators/table_2_value_table_with_header_comparator.py,sha256=VKwA7PbXnE-gFSKWlDCsJv0tkWVuNY-C4aWt2tyIybE,1911
|
|
430
|
-
holado_value/common/tables/converters/value_table_converter.py,sha256=
|
|
431
|
+
holado_value/common/tables/converters/value_table_converter.py,sha256=L0XIMxXv09fgcB6aJ8Wjg8FUw70PJ8A66ZBvBcA-P0o,9790
|
|
431
432
|
holado_value/common/tools/unique_value_manager.py,sha256=UXKdDKWznp4auYKQeWB7zYEzfm_0GxAiGfyoFM5ZM3s,5223
|
|
432
|
-
holado_value/common/tools/value.py,sha256=
|
|
433
|
-
holado_value/common/tools/value_types.py,sha256=
|
|
433
|
+
holado_value/common/tools/value.py,sha256=KQUzjSmGNpofevjSPzaBVDIgOGpztRoVuxLwQDTGL-4,9020
|
|
434
|
+
holado_value/common/tools/value_types.py,sha256=7nJp5D7xdoT9jMeeOxHIuPRykDyI9fXpve37ndK32gs,1801
|
|
434
435
|
holado_value/tests/behave/steps/__init__.py,sha256=BHp8TYE_X4lWn4B8A51nXSYaJlczuiDVJLcKMy7p0Lw,1267
|
|
435
436
|
holado_value/tests/behave/steps/private/__init__.py,sha256=BHp8TYE_X4lWn4B8A51nXSYaJlczuiDVJLcKMy7p0Lw,1267
|
|
436
437
|
holado_ws/__init__.py,sha256=z0SNFOdBBWUouC12WKDmL18T_OH3TdmfcgIbnNQzbjU,1247
|
|
@@ -459,6 +460,8 @@ test_holado/features/NonReg/common/tables/value_table_conversion.feature,sha256=
|
|
|
459
460
|
test_holado/features/NonReg/common/tools/DateTime.feature,sha256=Gf59f3iOdlE2fDnnZyNhz9SMqnl0W9mfLKvaWQVPuv4,3606
|
|
460
461
|
test_holado/features/NonReg/common/tools/UniqueValueManager.feature,sha256=Ok-f0RB01KQGIbEVyZ8nNmXJ3Y-qs3rzHg1_EPHIkuQ,995
|
|
461
462
|
test_holado/features/NonReg/holado_ais/ais_message-bitarray_to_nmea.feature,sha256=TmkcvApBeUgZtehad1scUxJHwtGycv_8C9c8jRJl6Ds,14188
|
|
463
|
+
test_holado/features/NonReg/holado_binary/bit_series.error.feature,sha256=6RVQIb5oeuEHM-MvR0z9t_uT81GY0MbpZOxZp4qf_x4,1903
|
|
464
|
+
test_holado/features/NonReg/holado_binary/bit_series.feature,sha256=_FS1JMDFtt3LzBOhl92wgdznZJxbPAiFx9Z_p4mpJ_U,5730
|
|
462
465
|
test_holado/features/NonReg/holado_protobuf/protobuf.feature,sha256=5PjD4R_ow3lMwWNFuemGZ6J0_A2_pzn-oNY4aV-wsGg,11857
|
|
463
466
|
test_holado/features/NonReg/holado_python/convert.feature,sha256=rVBWdy43UbWNfnBB_mENQwN6ArdcxJ5fN2C2nPKihhE,498
|
|
464
467
|
test_holado/features/NonReg/holado_python/iterable.feature,sha256=dqdkCYM1xsWWOBowCpW7t6hG2ZBWHS4NqrFgfgcKp7Q,1574
|
|
@@ -470,12 +473,10 @@ test_holado/features/NonReg/holado_scripting/common/tools/variable_manager.featu
|
|
|
470
473
|
test_holado/features/NonReg/holado_scripting/text/interpreter/interpreter.error.feature,sha256=IgBbkgJrV1VX7wT1ZcT-bQjIdbKdhsMDwz-GrN8N29A,674
|
|
471
474
|
test_holado/features/NonReg/holado_scripting/text/interpreter/interpreter.feature,sha256=FR5avmNZq1ts7FvcwxjD0coeBFA7vpOcRzUxV7SiArs,3584
|
|
472
475
|
test_holado/features/NonReg/holado_yaml/yaml.feature,sha256=vItBUxKKih5xUwsbm-0QyCsTMa6GaSeGjcZxh28GAlg,9216
|
|
473
|
-
test_holado/features/NonReg/ipc/bit_series.error.feature,sha256=6RVQIb5oeuEHM-MvR0z9t_uT81GY0MbpZOxZp4qf_x4,1903
|
|
474
|
-
test_holado/features/NonReg/ipc/bit_series.feature,sha256=Su3z_FaJmxCnswXqU5NY3hb5xrUDrm68ccttLvopmUU,5545
|
|
475
476
|
test_holado/features/NonReg/ipc/json.feature,sha256=zDtpngH-8Hn4Kx7tJ02OozzmZZnrwxNGXvp-WmpEsP8,5336
|
|
476
477
|
test_holado/features/NonReg/scenario/scenario.feature,sha256=0zSkDhxB1dDFyetbNY4AzQR3RVM00o8FoQONdxL6pBI,4806
|
|
477
478
|
test_holado/features/NonReg/test_steps/behave.feature,sha256=JOcJo-TOFPrENsCHOwsgKxIuDDzMY4SopnPs2qG6lw4,6596
|
|
478
|
-
test_holado/features/NonReg/test_steps/common.feature,sha256=
|
|
479
|
+
test_holado/features/NonReg/test_steps/common.feature,sha256=4zF8L-PoqoQBbqL5YCVIUv8mEN2G7OoLsd4Q1Y1DfEU,4181
|
|
479
480
|
test_holado/features/NonReg/tools/RabbitMQ.feature,sha256=z9Wt-besBO2fTh730YWFmruJu1cdcGbFk65u1gkcfnY,19204
|
|
480
481
|
test_holado/features/NonReg/tools/RabbitMQ_steps.feature,sha256=Mm8iho2w44DQYm2brwTYMzaq-s2W2Z15gEbiSXK-xwY,9767
|
|
481
482
|
test_holado/features/NonReg/tools/db_sqlite3.feature,sha256=3mmF69O-_oidKyPEn2cGPeYuM8_3ePUkfWWEcLw6Ra4,1362
|
|
@@ -529,7 +530,7 @@ test_holado/tools/django/api_rest/api_rest/api1/serializers.py,sha256=o_YxFr-tgC
|
|
|
529
530
|
test_holado/tools/django/api_rest/api_rest/api1/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
|
530
531
|
test_holado/tools/django/api_rest/api_rest/api1/views.py,sha256=kOt2xT6bxO47_z__5yYR9kcYIWWv4qYzpX0K8Tqonik,758
|
|
531
532
|
test_holado/tools/django/api_rest/api_rest/api1/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
532
|
-
holado-0.2.
|
|
533
|
-
holado-0.2.
|
|
534
|
-
holado-0.2.
|
|
535
|
-
holado-0.2.
|
|
533
|
+
holado-0.2.6.dist-info/METADATA,sha256=vlZiMQxP7ioBKPqSj3wjfyqn9Rys9oZ-D7wJBEIeBh4,5796
|
|
534
|
+
holado-0.2.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
535
|
+
holado-0.2.6.dist-info/licenses/LICENSE,sha256=IgGmNlcFHnbp7UWrLJqAFvs_HIgjJDTmjCNRircJLsk,1070
|
|
536
|
+
holado-0.2.6.dist-info/RECORD,,
|
|
@@ -107,7 +107,7 @@ class ScopeWhileSteps(ScopeSteps):
|
|
|
107
107
|
self._process_start()
|
|
108
108
|
try:
|
|
109
109
|
n = 0
|
|
110
|
-
cond = self.__expression_evaluator.evaluate_python_expression(self.__condition_expression)
|
|
110
|
+
_, cond = self.__expression_evaluator.evaluate_python_expression(self.__condition_expression)
|
|
111
111
|
if not (isinstance(cond, bool) or Converter.is_boolean(cond)):
|
|
112
112
|
raise FunctionalException(f"Condition expression is not a boolean: [{self.__condition_expression}] => [{cond}] (type: {Typing.get_object_class_fullname(cond)})")
|
|
113
113
|
|
|
@@ -129,7 +129,7 @@ class ScopeWhileSteps(ScopeSteps):
|
|
|
129
129
|
if self.__scope_manager:
|
|
130
130
|
self.__scope_manager.reset_scope_level("steps", origin_level)
|
|
131
131
|
|
|
132
|
-
cond = self.__expression_evaluator.evaluate_python_expression(self.__condition_expression)
|
|
132
|
+
_, cond = self.__expression_evaluator.evaluate_python_expression(self.__condition_expression)
|
|
133
133
|
if not (isinstance(cond, bool) or Converter.is_boolean(cond)):
|
|
134
134
|
raise FunctionalException(f"Condition expression is not a boolean: [{self.__condition_expression}] => [{cond}] (type: {Typing.get_object_class_fullname(cond)})")
|
|
135
135
|
finally:
|
|
@@ -108,13 +108,13 @@ class PersistedMethodToCallManager(PersistedDataManager):
|
|
|
108
108
|
self.delete_persisted_data(filter_data)
|
|
109
109
|
|
|
110
110
|
def _call_function_or_method(self, function_or_method_data):
|
|
111
|
-
func = self.__expression_evaluator.evaluate_python_expression(function_or_method_data['function_qualname'])
|
|
111
|
+
_, func = self.__expression_evaluator.evaluate_python_expression(function_or_method_data['function_qualname'])
|
|
112
112
|
if not Typing.is_function(func):
|
|
113
113
|
raise TechnicalException(f"Failed to evaluate python expression '{function_or_method_data['function_qualname']}' as a function (obtained: {func} [type: {Typing.get_object_class_fullname(func)}] ; function data: {function_or_method_data})")
|
|
114
114
|
|
|
115
115
|
func_self = None
|
|
116
116
|
if function_or_method_data['self_getter'] is not None:
|
|
117
|
-
func_self = self.__expression_evaluator.evaluate_python_expression(function_or_method_data['self_getter'])
|
|
117
|
+
_, func_self = self.__expression_evaluator.evaluate_python_expression(function_or_method_data['self_getter'])
|
|
118
118
|
|
|
119
119
|
if function_or_method_data['args'] is not None:
|
|
120
120
|
args = json.loads(function_or_method_data['args'])
|
|
@@ -90,12 +90,17 @@ class Tools(object):
|
|
|
90
90
|
|
|
91
91
|
if Converter.is_dict(obj):
|
|
92
92
|
# logger.print(f"+++++ Tools.__represent_object: is dict")
|
|
93
|
-
res_list = [f"{str(type(obj))}({id_obj})"] if full_details else [
|
|
93
|
+
res_list = [f"{str(type(obj))}({id_obj})"] if full_details else []
|
|
94
94
|
# keys = sorted(value.keys())
|
|
95
95
|
keys = list(obj.keys())
|
|
96
96
|
for key in keys:
|
|
97
97
|
# logger.print(f"+++++ Tools.__represent_object: key: {key}")
|
|
98
|
-
|
|
98
|
+
val_str = cls.__represent_object(obj[key], 0, True, full_details, access_type, _internal)
|
|
99
|
+
if '\n' in val_str:
|
|
100
|
+
res_list.append(f" {key}:")
|
|
101
|
+
res_list.append(Tools.indent_string(4, val_str))
|
|
102
|
+
else:
|
|
103
|
+
res_list.append(f" {key}: {val_str}")
|
|
99
104
|
res = "\n".join(res_list)
|
|
100
105
|
elif Converter.is_list(obj):
|
|
101
106
|
# logger.print(f"+++++ Tools.__represent_object: is list")
|
|
@@ -104,7 +109,13 @@ class Tools(object):
|
|
|
104
109
|
for el in obj:
|
|
105
110
|
# for index, el in enumerate(obj):
|
|
106
111
|
# logger.print(f"+++++ Tools.__represent_object: index: {index}")
|
|
107
|
-
|
|
112
|
+
el_str = cls.__represent_object(el, 0, True, full_details, access_type, _internal)
|
|
113
|
+
if '\n' in el_str:
|
|
114
|
+
res_list.append(" {")
|
|
115
|
+
res_list.append(Tools.indent_string(4, el_str))
|
|
116
|
+
res_list.append(" }")
|
|
117
|
+
else:
|
|
118
|
+
res_list.append(f" {el_str}")
|
|
108
119
|
if not full_details:
|
|
109
120
|
res_list.append("]")
|
|
110
121
|
res = "\n".join(res_list)
|
|
@@ -141,13 +152,19 @@ class Tools(object):
|
|
|
141
152
|
return res
|
|
142
153
|
|
|
143
154
|
@classmethod
|
|
144
|
-
def
|
|
145
|
-
return
|
|
155
|
+
def do_log_level(cls, log_level, max_log_level):
|
|
156
|
+
"""Define the log level to use: if log_level is greater than max_log_level, return max_log_level.
|
|
157
|
+
"""
|
|
158
|
+
return min(log_level, max_log_level)
|
|
146
159
|
|
|
147
160
|
@classmethod
|
|
148
|
-
def
|
|
161
|
+
def do_log(cls, logger, log_level, max_log_level=logging.CRITICAL):
|
|
162
|
+
return logger.isEnabledFor(cls.do_log_level(log_level, max_log_level))
|
|
163
|
+
|
|
164
|
+
@classmethod
|
|
165
|
+
def do_log_if_objects_are_different(cls, logger, log_level, obj1, obj2, max_log_level=logging.CRITICAL):
|
|
149
166
|
try:
|
|
150
|
-
return cls.do_log(logger, log_level) and (obj1 != obj2)
|
|
167
|
+
return cls.do_log(logger, log_level, max_log_level) and (obj1 != obj2)
|
|
151
168
|
except Exception as exc:
|
|
152
169
|
if Tools.do_log(logger, logging.TRACE): # @UndefinedVariable
|
|
153
170
|
logger.trace(f"Assume a log is needed since usually a comparison fails on mismatching types and thus objects are different. Obtained error: {exc}")
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
|
|
2
|
+
#################################################
|
|
3
|
+
# HolAdo (Holistic Automation do)
|
|
4
|
+
#
|
|
5
|
+
# (C) Copyright 2021-2025 by Eric Klumpp
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
#
|
|
9
|
+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
10
|
+
|
|
11
|
+
# The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
|
|
12
|
+
#################################################
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
#################################################
|
|
16
|
+
# GOAL: Tools when using a clone of HolAdo project.
|
|
17
|
+
#
|
|
18
|
+
# This file contains methods usefull to initialize environments using a clone of HolAdo project.
|
|
19
|
+
#
|
|
20
|
+
# USAGE:
|
|
21
|
+
# - Copy this file in projects using HolAdo.
|
|
22
|
+
# - Define environment variable HOLADO_PATH with path to cloned HolAdo project.
|
|
23
|
+
# If HOLADO_PATH is defined, sources of cloned HolAdo project are used, else installed holado package is used.
|
|
24
|
+
#################################################
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
import os
|
|
29
|
+
import sys
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def insert_sys_path(path, index=0):
|
|
33
|
+
"""Insert a path in sys.path if it doesn't already exists.
|
|
34
|
+
"""
|
|
35
|
+
if path not in sys.path:
|
|
36
|
+
sys.path.insert(index, path)
|
|
37
|
+
|
|
38
|
+
def insert_sys_paths(list_paths, index=0):
|
|
39
|
+
"""Insert a list of path in sys.path if it doesn't already exists.
|
|
40
|
+
"""
|
|
41
|
+
if list_paths:
|
|
42
|
+
for path in list_paths:
|
|
43
|
+
insert_sys_path(path, index=index)
|
|
44
|
+
|
|
45
|
+
def insert_holado_source_paths(with_test_behave=True):
|
|
46
|
+
"""Insert in sys.path all HolAdo source paths.
|
|
47
|
+
If environment variable HOLADO_PATH is defined with path to HolAdo project, following paths are inserted in sys.path:
|
|
48
|
+
- HOLADO_PATH/src: path to holado modules sources
|
|
49
|
+
- HOLADO_PATH/tests/behave (if with_test_behave==True): path to holado test sources, needed by testing solutions
|
|
50
|
+
"""
|
|
51
|
+
holado_path = os.getenv('HOLADO_PATH')
|
|
52
|
+
if holado_path is None:
|
|
53
|
+
try:
|
|
54
|
+
import holado # @UnusedImport
|
|
55
|
+
except Exception as exc:
|
|
56
|
+
if "No module named" in str(exc):
|
|
57
|
+
raise Exception(f"If environment variable HOLADO_PATH is not defined with path to HolAdo project, 'holado' python package must be installed")
|
|
58
|
+
else:
|
|
59
|
+
raise exc
|
|
60
|
+
else:
|
|
61
|
+
# holado is installed, and all sources are already accessible
|
|
62
|
+
pass
|
|
63
|
+
else:
|
|
64
|
+
print(f"Using HolAdo project installed in '{holado_path}'")
|
|
65
|
+
# import traceback
|
|
66
|
+
# print("".join(traceback.format_list(traceback.extract_stack())))
|
|
67
|
+
# insert_sys_path(holado_path)
|
|
68
|
+
insert_sys_path(os.path.join(holado_path, "src"))
|
|
69
|
+
if with_test_behave:
|
|
70
|
+
insert_sys_path(os.path.join(holado_path, "tests", "behave"))
|
|
71
|
+
|
|
72
|
+
|
holado_helper/script/action.py
CHANGED
|
@@ -19,6 +19,7 @@ from holado_core.common.tools.tools import Tools
|
|
|
19
19
|
from holado_core.common.actors.actions import Action
|
|
20
20
|
from holado_core.common.exceptions.technical_exception import TechnicalException
|
|
21
21
|
from holado_python.standard_library.typing import Typing
|
|
22
|
+
from holado.common.handlers.undefined import not_applicable
|
|
22
23
|
|
|
23
24
|
logger = logging.getLogger(__name__)
|
|
24
25
|
|
|
@@ -80,22 +81,33 @@ class BehaveActionRunner():
|
|
|
80
81
|
self.__action = FeaturesBehaveAction(action_info.behave_args, variable_manager)
|
|
81
82
|
self.__action_info = action_info
|
|
82
83
|
|
|
84
|
+
def __compute_variable_values(self):
|
|
85
|
+
res = {}
|
|
86
|
+
self.__add_variable_values(res, self.__action_info.static_params)
|
|
87
|
+
self.__add_variable_values(res, self.__action_info.params)
|
|
88
|
+
return res
|
|
89
|
+
|
|
90
|
+
def __add_variable_values(self, res, params):
|
|
91
|
+
if params:
|
|
92
|
+
for key, value in params.items():
|
|
93
|
+
if key == 'STATUS':
|
|
94
|
+
continue
|
|
95
|
+
if value is not_applicable:
|
|
96
|
+
res[key] = 'N/A'
|
|
97
|
+
else:
|
|
98
|
+
res[key] = value
|
|
99
|
+
|
|
83
100
|
def run(self):
|
|
84
101
|
logger.info(f"Processing action '{self.__action_info.action}' of index {self.__action_info.index}: {self.__action_info.params}")
|
|
85
102
|
if Tools.do_log(logger, logging.DEBUG):
|
|
86
103
|
logger.debug(f"Running behave with arguments '{self.__action_info.behave_args}' on action of index {self.__action_info.index}: {self.__action_info.params}")
|
|
87
104
|
|
|
88
|
-
variable_values =
|
|
89
|
-
if self.__action_info.static_params:
|
|
90
|
-
for key, value in self.__action_info.static_params.items():
|
|
91
|
-
variable_values[key] = value
|
|
92
|
-
if self.__action_info.params:
|
|
93
|
-
for key, value in self.__action_info.params.items():
|
|
94
|
-
if key == 'STATUS':
|
|
95
|
-
continue
|
|
96
|
-
variable_values[key] = value
|
|
105
|
+
variable_values = self.__compute_variable_values()
|
|
97
106
|
|
|
98
107
|
logger.info(f"Launching behave with arguments: {self.__action_info.behave_args}")
|
|
108
|
+
if Tools.do_log(logger, logging.DEBUG):
|
|
109
|
+
if variable_values:
|
|
110
|
+
logger.debug(f" and with variables:\n{Tools.represent_object(variable_values, 8)}")
|
|
99
111
|
res = self.__action.execute(variable_values)
|
|
100
112
|
logger.info(f"behave finished with result: {res}")
|
|
101
113
|
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
# Usually, it is copied and adapted for specific usage.
|
|
17
17
|
|
|
18
18
|
import os
|
|
19
|
-
import sys
|
|
20
19
|
import logging
|
|
21
20
|
import argparse
|
|
21
|
+
from holado_helper.initialize_holado import insert_sys_path, insert_sys_paths
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def _chdir(path):
|
|
@@ -26,26 +26,6 @@ def _chdir(path):
|
|
|
26
26
|
os.chdir(path)
|
|
27
27
|
return res
|
|
28
28
|
|
|
29
|
-
def __insert_sys_path(path):
|
|
30
|
-
if path not in sys.path:
|
|
31
|
-
sys.path.insert(0, path)
|
|
32
|
-
|
|
33
|
-
def _insert_sys_paths(additional_sys_paths=None):
|
|
34
|
-
# Insert additional paths
|
|
35
|
-
if additional_sys_paths is not None:
|
|
36
|
-
for sp in additional_sys_paths:
|
|
37
|
-
__insert_sys_path(sp)
|
|
38
|
-
|
|
39
|
-
# Insert Holado paths
|
|
40
|
-
holado_path = os.getenv('HOLADO_PATH')
|
|
41
|
-
if holado_path is None:
|
|
42
|
-
# If HolAdo sources are not cloned on this environment, use path within this installation
|
|
43
|
-
from holado import get_holado_path
|
|
44
|
-
holado_path = get_holado_path()
|
|
45
|
-
__insert_sys_path(os.path.join(holado_path) )
|
|
46
|
-
__insert_sys_path(os.path.join(holado_path, "src") )
|
|
47
|
-
__insert_sys_path(os.path.join(holado_path, "tests", "behave") )
|
|
48
|
-
|
|
49
29
|
def _initialize_holado(TSessionContext=None, logging_config_file_path=None, log_level=logging.WARNING, log_in_file=False, with_session_path=False, **kwargs):
|
|
50
30
|
import holado
|
|
51
31
|
session_kwargs={'with_session_path':with_session_path or log_in_file}
|
|
@@ -67,7 +47,7 @@ def initialize(work_dir_path=None, change_work_dir=True,
|
|
|
67
47
|
|
|
68
48
|
if additional_sys_paths:
|
|
69
49
|
sys_paths.extend(additional_sys_paths)
|
|
70
|
-
|
|
50
|
+
insert_sys_paths(sys_paths)
|
|
71
51
|
|
|
72
52
|
logging_config_file_path=None
|
|
73
53
|
for dir_path in [res, work_dir_path, os.getcwd()]:
|
|
@@ -84,7 +64,7 @@ def initialize(work_dir_path=None, change_work_dir=True,
|
|
|
84
64
|
def change_working_dir(work_dir_path=None):
|
|
85
65
|
if work_dir_path:
|
|
86
66
|
res = _chdir(work_dir_path)
|
|
87
|
-
|
|
67
|
+
insert_sys_path(work_dir_path)
|
|
88
68
|
return res
|
|
89
69
|
else:
|
|
90
70
|
return None
|
holado_helper/script/script.py
CHANGED
|
@@ -76,7 +76,7 @@ class Script(object):
|
|
|
76
76
|
return parser
|
|
77
77
|
|
|
78
78
|
def change_working_dir(self, work_dir_path):
|
|
79
|
-
from initialize_script import change_working_dir as init_cd # @UnresolvedImport
|
|
79
|
+
from holado_helper.script.initialize_script import change_working_dir as init_cd # @UnresolvedImport
|
|
80
80
|
|
|
81
81
|
# If user working dir is not yet defined, save current working dir as user working dir
|
|
82
82
|
if self.__user_work_dir is None:
|
|
@@ -90,7 +90,7 @@ class Script(object):
|
|
|
90
90
|
|
|
91
91
|
def initialize(self):
|
|
92
92
|
if self.args is not None and hasattr(self.args, 'log_level') and hasattr(self.args, 'log_in_file'):
|
|
93
|
-
from initialize_script import change_logging_config # @UnresolvedImport
|
|
93
|
+
from holado_helper.script.initialize_script import change_logging_config # @UnresolvedImport
|
|
94
94
|
change_logging_config(log_level=self.args.log_level, log_in_file=self.args.log_in_file)
|
|
95
95
|
|
|
96
96
|
def run(self):
|
|
@@ -301,7 +301,7 @@ class ProtobufMessages(object):
|
|
|
301
301
|
if ValueTableManager.verify_table_is_name_value_table(fields_table, raise_exception=False):
|
|
302
302
|
self.__set_object_fields_with_name_value_table(res, fields_table)
|
|
303
303
|
else:
|
|
304
|
-
raise TechnicalException(f"When defining parameter fields_table, it must be a Name/Value table")
|
|
304
|
+
raise TechnicalException(f"When defining parameter fields_table, it must be a Name/Value table: [{Typing.get_object_class_fullname(fields_table)}]\n{fields_table.represent(4)}")
|
|
305
305
|
elif fields_dict is not None:
|
|
306
306
|
self.__set_object_fields_with_dict(res, fields_dict)
|
|
307
307
|
|