holado 0.2.5__py3-none-any.whl → 0.2.7__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.7.dist-info}/METADATA +1 -1
- {holado-0.2.5.dist-info → holado-0.2.7.dist-info}/RECORD +32 -31
- holado_core/common/block/scope_steps.py +2 -2
- holado_core/common/resource/persisted_method_to_call_manager.py +18 -5
- holado_core/common/tools/tools.py +26 -9
- holado_core/tests/behave/steps/common/tables_steps.py +1 -1
- 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 +3 -2
- 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.7.dist-info}/WHEEL +0 -0
- {holado-0.2.5.dist-info → holado-0.2.7.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=M_1G8OKwOUn5ha18MOwXD3kXz2-1XOyUP0H9QYvg6FQ,7756
|
|
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=N-MfdMPYQs2BVnX4QWgop5PflzanboHjOeKgoSmpB1o,9062
|
|
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
|
|
@@ -138,7 +138,7 @@ holado_core/tests/behave/steps/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
138
138
|
holado_core/tests/behave/steps/common/common_steps.py,sha256=SAsi_UD9khKfXfS23IEQIPp4sTLG4EkDXrjc-9a9yDg,6295
|
|
139
139
|
holado_core/tests/behave/steps/common/config_steps.py,sha256=fuV-83Aol9J92Ho9c-bt48G6ARbTM0vyfritQo-GpvY,1910
|
|
140
140
|
holado_core/tests/behave/steps/common/resource_steps.py,sha256=FPQpN6I-vsxIkqTOSyB9i8P7oyg7Mf1XepHiPzmrlMk,3030
|
|
141
|
-
holado_core/tests/behave/steps/common/tables_steps.py,sha256=
|
|
141
|
+
holado_core/tests/behave/steps/common/tables_steps.py,sha256=Xr40QDcaJM9T1DKIKer1MxYR1ypqEcW-LDGVurE5b0o,26382
|
|
142
142
|
holado_core/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
143
143
|
holado_core/tools/abstracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
144
144
|
holado_core/tools/abstracts/blocking_command_service.py,sha256=8EFNQZONFw1jeGAG7gJ59FmookKkjiC4IYkk2UTsbSs,2603
|
|
@@ -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=gYYxEfey_xRp80VahqGF5N0RDIvT-NqCslTXTId_3Vw,10423
|
|
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=fWR_l12SEq47G3aMuRtsCz5ly_2HNdxIUluUokDaaE4,9022
|
|
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.7.dist-info/METADATA,sha256=SvuQzxFGmfj6dmBW6Gpwr5vilZuKxFwgHACPmgLKDrI,5796
|
|
534
|
+
holado-0.2.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
535
|
+
holado-0.2.7.dist-info/licenses/LICENSE,sha256=IgGmNlcFHnbp7UWrLJqAFvs_HIgjJDTmjCNRircJLsk,1070
|
|
536
|
+
holado-0.2.7.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:
|
|
@@ -16,6 +16,7 @@ import json
|
|
|
16
16
|
from holado_core.common.resource.persisted_data_manager import PersistedDataManager
|
|
17
17
|
from holado_python.standard_library.typing import Typing
|
|
18
18
|
from holado_core.common.exceptions.technical_exception import TechnicalException
|
|
19
|
+
from holado_core.common.tools.tools import Tools
|
|
19
20
|
|
|
20
21
|
logger = logging.getLogger(__name__)
|
|
21
22
|
|
|
@@ -98,9 +99,21 @@ class PersistedMethodToCallManager(PersistedDataManager):
|
|
|
98
99
|
|
|
99
100
|
# Call methods
|
|
100
101
|
if methods_data:
|
|
101
|
-
for meth_data in methods_data:
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
for meth_index, meth_data in enumerate(methods_data):
|
|
103
|
+
do_delete = delete_after_call
|
|
104
|
+
try:
|
|
105
|
+
self._call_function_or_method(meth_data)
|
|
106
|
+
except Exception as exc:
|
|
107
|
+
msg_list = [f"Error while calling following method (use: '{use}' ; use index: {use_index} ; method index: {meth_index} ; delete after call: {delete_after_call}):"]
|
|
108
|
+
msg_list.append(Tools.represent_object(meth_data, 8))
|
|
109
|
+
msg_list.append(" Error:")
|
|
110
|
+
msg_list.append(Tools.represent_exception(exc, indent=8))
|
|
111
|
+
msg_list.append(" => Continue to process persisted methods")
|
|
112
|
+
msg_list.append(" WARNING: this method is removed from persisted methods to avoid recursive and blocking errors")
|
|
113
|
+
logger.error("\n".join(msg_list))
|
|
114
|
+
do_delete = True
|
|
115
|
+
|
|
116
|
+
if do_delete:
|
|
104
117
|
self.__delete_function_or_method(meth_data)
|
|
105
118
|
|
|
106
119
|
def __delete_function_or_method(self, function_or_method_data):
|
|
@@ -108,13 +121,13 @@ class PersistedMethodToCallManager(PersistedDataManager):
|
|
|
108
121
|
self.delete_persisted_data(filter_data)
|
|
109
122
|
|
|
110
123
|
def _call_function_or_method(self, function_or_method_data):
|
|
111
|
-
func = self.__expression_evaluator.evaluate_python_expression(function_or_method_data['function_qualname'])
|
|
124
|
+
_, func = self.__expression_evaluator.evaluate_python_expression(function_or_method_data['function_qualname'])
|
|
112
125
|
if not Typing.is_function(func):
|
|
113
126
|
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
127
|
|
|
115
128
|
func_self = None
|
|
116
129
|
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'])
|
|
130
|
+
_, func_self = self.__expression_evaluator.evaluate_python_expression(function_or_method_data['self_getter'])
|
|
118
131
|
|
|
119
132
|
if function_or_method_data['args'] is not None:
|
|
120
133
|
args = json.loads(function_or_method_data['args'])
|
|
@@ -60,7 +60,7 @@ class Tools(object):
|
|
|
60
60
|
return text
|
|
61
61
|
|
|
62
62
|
@classmethod
|
|
63
|
-
def represent_exception(cls, exc, tb=None):
|
|
63
|
+
def represent_exception(cls, exc, tb=None, indent=0):
|
|
64
64
|
if sys.version_info >= (3,10):
|
|
65
65
|
if tb is not None:
|
|
66
66
|
list_format = traceback.format_exception(exc, value=exc, tb=tb)
|
|
@@ -68,7 +68,7 @@ class Tools(object):
|
|
|
68
68
|
list_format = traceback.format_exception(exc)
|
|
69
69
|
else:
|
|
70
70
|
list_format = traceback.format_exception(type(exc), exc, exc.__traceback__)
|
|
71
|
-
return "".join(list_format)
|
|
71
|
+
return Tools.indent_string(indent, "".join(list_format))
|
|
72
72
|
|
|
73
73
|
@classmethod
|
|
74
74
|
def represent_object(cls, obj, indent=0, *, do_indent_first_line=True, full_details=False, access_type=AccessType.Public):
|
|
@@ -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}")
|
|
@@ -328,7 +328,7 @@ def step_impl(context, var_name, table_varname, col_name):
|
|
|
328
328
|
cell_rep_value = row_replace[tr_indexes["Replace Value"]] if "Replace Value" in tr_indexes else None
|
|
329
329
|
|
|
330
330
|
if cell_cond_value is not None:
|
|
331
|
-
cond = (cell_cond_value.
|
|
331
|
+
cond = (cell_cond_value.content_type == ValueTypes.Symbol and cell_cond_value.content == 'DEFAULT'
|
|
332
332
|
or cell_cond_value.value_type != ValueTypes.NotApplicable and cell.content == cell_cond_value.value)
|
|
333
333
|
elif cell_cond_expr is not None:
|
|
334
334
|
cond = tcell_comparator.equals(cell, cell_cond_expr, raise_exception = False)
|
|
@@ -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
|
|