holado 0.8.0__py3-none-any.whl → 0.8.2__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/common/context/context.py +1 -4
- holado/common/context/session_context.py +1 -2
- {holado-0.8.0.dist-info → holado-0.8.2.dist-info}/METADATA +3 -8
- {holado-0.8.0.dist-info → holado-0.8.2.dist-info}/RECORD +15 -15
- holado_docker/tools/docker_controller/client/rest/docker_controller_client.py +4 -4
- holado_docker/tools/docker_controller/server/rest/api/config.py +9 -1
- holado_docker/tools/docker_controller/server/rest/openapi.yaml +18 -1
- holado_python/standard_library/ssl/resources/certificates/tcpbin.crt +16 -16
- holado_python/standard_library/ssl/resources/certificates/tcpbin.key +26 -26
- holado_system/system/filesystem/file.py +44 -1
- holado_system/tests/behave/steps/system/file_steps.py +12 -17
- holado_test/scenario/step_tools.py +22 -0
- holado_yaml/yaml/yaml_client.py +10 -2
- {holado-0.8.0.dist-info → holado-0.8.2.dist-info}/WHEEL +0 -0
- {holado-0.8.0.dist-info → holado-0.8.2.dist-info}/licenses/LICENSE +0 -0
holado/common/context/context.py
CHANGED
|
@@ -39,10 +39,6 @@ class Context(DeleteableObject):
|
|
|
39
39
|
self.__persisted_method_to_call_manager_inst = None
|
|
40
40
|
self.__post_process_funcs = []
|
|
41
41
|
|
|
42
|
-
def initialize(self):
|
|
43
|
-
if self.__with_post_process:
|
|
44
|
-
self.__persisted_method_to_call_manager.ensure_persistent_db_exists()
|
|
45
|
-
|
|
46
42
|
@property
|
|
47
43
|
def __with_post_process(self):
|
|
48
44
|
return hasattr(self, '_Context__persisted_method_to_call_manager_inst')
|
|
@@ -61,6 +57,7 @@ class Context(DeleteableObject):
|
|
|
61
57
|
from holado_core.common.resource.persisted_method_to_call_manager import PersistedMethodToCallManager
|
|
62
58
|
self.__persisted_method_to_call_manager_inst = PersistedMethodToCallManager(scope_name=self.name, **self.__persisted_kwargs)
|
|
63
59
|
self.__persisted_method_to_call_manager_inst.initialize(SessionContext.instance().resource_manager, SessionContext.instance().expression_evaluator)
|
|
60
|
+
self.__persisted_method_to_call_manager_inst.ensure_persistent_db_exists()
|
|
64
61
|
return self.__persisted_method_to_call_manager_inst
|
|
65
62
|
|
|
66
63
|
def get_context_name(self):
|
|
@@ -120,7 +120,7 @@ class SessionContext(Context):
|
|
|
120
120
|
"""
|
|
121
121
|
Override this method to initialize the session context after its configuration and new session creation.
|
|
122
122
|
"""
|
|
123
|
-
|
|
123
|
+
pass
|
|
124
124
|
|
|
125
125
|
@property
|
|
126
126
|
def services(self):
|
|
@@ -292,7 +292,6 @@ class SessionContext(Context):
|
|
|
292
292
|
# Create and initialize ScenarioContext
|
|
293
293
|
scenario_context = ScenarioContext(scenario)
|
|
294
294
|
self.get_feature_context().add_scenario(scenario_context)
|
|
295
|
-
scenario_context.initialize()
|
|
296
295
|
|
|
297
296
|
# Set variable with scenario context instance
|
|
298
297
|
self.get_scenario_context().get_variable_manager().register_variable("SCENARIO_CONTEXT", self.get_scenario_context())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: holado
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.2
|
|
4
4
|
Summary: HolAdo framework
|
|
5
5
|
Project-URL: Homepage, https://gitlab.com/holado_framework/python
|
|
6
6
|
Project-URL: Issues, https://gitlab.com/holado_framework/python/-/issues
|
|
@@ -17,7 +17,9 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
17
17
|
Requires-Python: >=3.10
|
|
18
18
|
Requires-Dist: behave==1.2.7.dev6
|
|
19
19
|
Requires-Dist: psutil
|
|
20
|
+
Requires-Dist: pypika
|
|
20
21
|
Requires-Dist: python-dateutil
|
|
22
|
+
Requires-Dist: sql-metadata
|
|
21
23
|
Provides-Extra: ais
|
|
22
24
|
Requires-Dist: pyais; extra == 'ais'
|
|
23
25
|
Provides-Extra: all
|
|
@@ -43,25 +45,18 @@ Requires-Dist: psycopg-binary; extra == 'all'
|
|
|
43
45
|
Requires-Dist: pyais; extra == 'all'
|
|
44
46
|
Requires-Dist: pympler; extra == 'all'
|
|
45
47
|
Requires-Dist: pyopenssl; extra == 'all'
|
|
46
|
-
Requires-Dist: pypika; extra == 'all'
|
|
47
48
|
Requires-Dist: pysftp; extra == 'all'
|
|
48
49
|
Requires-Dist: redis; extra == 'all'
|
|
49
50
|
Requires-Dist: redis-om; extra == 'all'
|
|
50
51
|
Requires-Dist: ruamel-yaml; extra == 'all'
|
|
51
52
|
Requires-Dist: sftpserver; extra == 'all'
|
|
52
|
-
Requires-Dist: sql-metadata; extra == 'all'
|
|
53
53
|
Requires-Dist: truststore; extra == 'all'
|
|
54
54
|
Requires-Dist: zeep; extra == 'all'
|
|
55
55
|
Provides-Extra: api-connexion
|
|
56
56
|
Requires-Dist: connexion[flask,swagger-ui,uvicorn]; extra == 'api-connexion'
|
|
57
|
-
Provides-Extra: db
|
|
58
|
-
Requires-Dist: pypika; extra == 'db'
|
|
59
|
-
Requires-Dist: sql-metadata; extra == 'db'
|
|
60
57
|
Provides-Extra: db-postgresql
|
|
61
58
|
Requires-Dist: psycopg; extra == 'db-postgresql'
|
|
62
59
|
Requires-Dist: psycopg-binary; extra == 'db-postgresql'
|
|
63
|
-
Requires-Dist: pypika; extra == 'db-postgresql'
|
|
64
|
-
Requires-Dist: sql-metadata; extra == 'db-postgresql'
|
|
65
60
|
Provides-Extra: docker
|
|
66
61
|
Requires-Dist: docker; extra == 'docker'
|
|
67
62
|
Provides-Extra: docker-tools
|
|
@@ -2,9 +2,9 @@ holado/__init__.py,sha256=ibxjS0XIck0rguf8FT_3HftofWmJqyfWraxjczMzzrw,14895
|
|
|
2
2
|
holado/holado_config.py,sha256=H1Wgndhz133nm0OcqS5hD6oDxZbDD_DeHJsKOuenQrI,2588
|
|
3
3
|
holado/common/__init__.py,sha256=ZjXM-FRQgnfzRNXqcvJOGewDHVRR-U5-ugStSs8U2Xs,1525
|
|
4
4
|
holado/common/context/__init__.py,sha256=3jJBLm8myrYF9jbdV1EhIA6BtnlmjX33eeoDpTzwmLA,1604
|
|
5
|
-
holado/common/context/context.py,sha256=
|
|
5
|
+
holado/common/context/context.py,sha256=MV8A6JSpUcTcfia_QzjyDLybQC50rZ-NA0ffotnHXQY,11994
|
|
6
6
|
holado/common/context/service_manager.py,sha256=LaCn8ukE1aqJynmwoexAYj5hCkdb_F3hXRtUBGqorUE,14087
|
|
7
|
-
holado/common/context/session_context.py,sha256=
|
|
7
|
+
holado/common/context/session_context.py,sha256=pNiJlyLsIiwdBCUb3aMQmTJB7ZnO0NsDMvluSd7_ZjE,23122
|
|
8
8
|
holado/common/handlers/__init__.py,sha256=d0KDUpaAAw1eBXyX08gaRh4RECnJlXjYQ0TcU-Ndicc,1372
|
|
9
9
|
holado/common/handlers/enums.py,sha256=ieqKVoukEiNyfE3KrKmMOImdbFS1ocUMud8JHe2xNLs,1662
|
|
10
10
|
holado/common/handlers/object.py,sha256=rDaav8zHTYfKVEaLtEdeXMxYXATGVcs2a7um1f5MvCs,7205
|
|
@@ -194,7 +194,7 @@ holado_docker/sdk/docker/docker_service.py,sha256=SvMSIZ7XTCbC7q5rur03lJhJVSHL3u
|
|
|
194
194
|
holado_docker/tests/behave/steps/__init__.py,sha256=lrP0btKLA3qQD2wp3zbOp0ug8RmgpaYWCrOAWehcPiI,1298
|
|
195
195
|
holado_docker/tests/behave/steps/tools/docker_controller/client_steps.py,sha256=Y26ZstOZrI3uVX6MGBQr88jjDEsCsNuik0ZBmpT5kDg,4800
|
|
196
196
|
holado_docker/tools/docker_controller/docker_controller_manager.py,sha256=q3oac2KIK9wGfMQqGIol65nHUmeuuV0rQ61tfH2APAk,2477
|
|
197
|
-
holado_docker/tools/docker_controller/client/rest/docker_controller_client.py,sha256=
|
|
197
|
+
holado_docker/tools/docker_controller/client/rest/docker_controller_client.py,sha256=rySX7cK-SBfYRLnspntm8tWuDVyHEGuxFs9vJm7wHDA,4316
|
|
198
198
|
holado_docker/tools/docker_controller/server/Dockerfile,sha256=zuSkj3HYDhvpjOSXmxL4oDqhN7dRB1YTX5Fyur1cuDY,1774
|
|
199
199
|
holado_docker/tools/docker_controller/server/requirements.txt,sha256=0RvLV3t2DyBR2FsbAd1WVEcbsVc6FVUN2horQJU4POo,57
|
|
200
200
|
holado_docker/tools/docker_controller/server/run_docker_controller_in_docker.sh,sha256=Q56P8VA895I29kVSaSa2FpzvjxJUwLVZ9-7vjScXfc0,3406
|
|
@@ -204,10 +204,10 @@ holado_docker/tools/docker_controller/server/grpc/proto/compile_proto.py,sha256=
|
|
|
204
204
|
holado_docker/tools/docker_controller/server/grpc/proto/definitions/docker_controler.proto,sha256=n9bsXaQfnZX-R5HvfquCVt3QjpFtDJSH6p8gnTjm06k,1650
|
|
205
205
|
holado_docker/tools/docker_controller/server/rest/README,sha256=-uqu3drdPXkPkU4ha1IKcXGBHFIBEWH-uiTT74DExwE,167
|
|
206
206
|
holado_docker/tools/docker_controller/server/rest/initialize_holado.py,sha256=UxNphXyjs-xraorzMWjDe6-QYw_Q3mtykyY-ENYZB1o,3464
|
|
207
|
-
holado_docker/tools/docker_controller/server/rest/openapi.yaml,sha256=
|
|
207
|
+
holado_docker/tools/docker_controller/server/rest/openapi.yaml,sha256=HUD7CHasVGjpd6yW9mU0sWOKs4tuG_VSoefa7NuQWFI,6773
|
|
208
208
|
holado_docker/tools/docker_controller/server/rest/run.py,sha256=8w5Xl7uOnjsYW59cmuUMOUd71fcXQn30k2jVis7cVNs,1748
|
|
209
209
|
holado_docker/tools/docker_controller/server/rest/api/__init__.py,sha256=FlLRagAiw1LDxnF0CmW7Y6bVXuj8x6volT8-DuHTTVY,2427
|
|
210
|
-
holado_docker/tools/docker_controller/server/rest/api/config.py,sha256=
|
|
210
|
+
holado_docker/tools/docker_controller/server/rest/api/config.py,sha256=Ln__1bsigSzJZ-Iy3MQgmiZMnpBxC3TCQE0O72g5cAs,2459
|
|
211
211
|
holado_docker/tools/docker_controller/server/rest/api/container.py,sha256=6D612WF4chpDCzr4MBzZXzELxi-yOwrgxCxSBBVMcVo,2673
|
|
212
212
|
holado_docker/tools/docker_controller/server/rest/api/os.py,sha256=ZdAbx_ZzwMaqHseOWWSf9ZPL_CEdRa2RvEXGvkk5c1o,1830
|
|
213
213
|
holado_docker/tools/docker_viewer/docker_viewer_manager.py,sha256=tSLuIUdYjJoZIFUc1k4WnrRTUtjjTAmNTbrDmS-8SjI,2287
|
|
@@ -363,8 +363,8 @@ holado_python/standard_library/ssl/resources/certificates/NOTES.txt,sha256=GlPGG
|
|
|
363
363
|
holado_python/standard_library/ssl/resources/certificates/localhost.crt,sha256=iLmZpDuOQVawUlbZkb72g2-uv1c4SAmRJOrm4Th5anY,1123
|
|
364
364
|
holado_python/standard_library/ssl/resources/certificates/localhost.key,sha256=lP2NCvB9mr2E5sk8whA8FyQRcyU6H7sdWkJeKz80Hyc,1704
|
|
365
365
|
holado_python/standard_library/ssl/resources/certificates/rootCACert.pem,sha256=ECQDZ8OHRfqpZHCu6JRLMUjiONaPIhKZQF0-kidVrWQ,1424
|
|
366
|
-
holado_python/standard_library/ssl/resources/certificates/tcpbin.crt,sha256=
|
|
367
|
-
holado_python/standard_library/ssl/resources/certificates/tcpbin.key,sha256=
|
|
366
|
+
holado_python/standard_library/ssl/resources/certificates/tcpbin.crt,sha256=a3fxUXYKjh5MpBo5vaFDlvGESD9n_HKWZ0GvKUjSBWE,1237
|
|
367
|
+
holado_python/standard_library/ssl/resources/certificates/tcpbin.key,sha256=FpUivY3CuG7xMiUcx-fdsIvaImzAJYJBOnxJ2GQevXI,1704
|
|
368
368
|
holado_python/tests/behave/steps/__init__.py,sha256=TWEk-kBTTDHi9I4nuu48nufmNMdZ9FHAhPZv0A_cWzc,1661
|
|
369
369
|
holado_python/tests/behave/steps/convert_steps.py,sha256=bZqRvJVp_u6fSPpdu4ne9NwVyZmui7R-AVdO2-H-I1A,2728
|
|
370
370
|
holado_python/tests/behave/steps/iterable_steps.py,sha256=f4vGIWBH8Qnjq69Q-ZBluYyctQ8SKauazTc41dsktZA,4041
|
|
@@ -480,10 +480,10 @@ holado_system/system/command/command.py,sha256=9lv9kgvvIq4Fqx6fJXU_HQA8pCO80Ws9r
|
|
|
480
480
|
holado_system/system/command/command_result.py,sha256=sunGDegNVOtpK9s9r4HCAJlREu4iKS0w3HY4KKDEQkw,4613
|
|
481
481
|
holado_system/system/command/curl_command.py,sha256=CEMaO0_qLyKe4tLytMlHzmCuS_gi-oU479hwOaEyZ60,3743
|
|
482
482
|
holado_system/system/command/exceptions.py,sha256=InT6t8GVeGCiBE-NpRr4NzycWVAvzmc6WpM6mk7_1yk,2363
|
|
483
|
-
holado_system/system/filesystem/file.py,sha256=
|
|
483
|
+
holado_system/system/filesystem/file.py,sha256=stIFMNPeJuQNYlrm-wQPdwnRP8SgLoah7hkjz0hvx5g,4084
|
|
484
484
|
holado_system/tests/behave/steps/__init__.py,sha256=7LrCSTHk5oHNuEsr4IhJuNDsohtR2cq3YT1owXrhdjc,1351
|
|
485
485
|
holado_system/tests/behave/steps/system/commands_steps.py,sha256=uYiojPpYPkfif8l8afRrJ0sj-wFBE4j1x67BDMNs76Q,3901
|
|
486
|
-
holado_system/tests/behave/steps/system/file_steps.py,sha256
|
|
486
|
+
holado_system/tests/behave/steps/system/file_steps.py,sha256=-RPUGEjsYfzWIMRDiQRalmvspPZIPP8YMzSZvSI4-p8,9966
|
|
487
487
|
holado_system/tests/behave/steps/system/system_steps.py,sha256=2XrZwuAaYDjB_HvPgxZq9MpYB_Zo7FVZ0DYcmtKht2s,3778
|
|
488
488
|
holado_test/__init__.py,sha256=A0edMOLhnuU-A_NazQ50WghvKvB889KNCBddtBPa9Ag,1539
|
|
489
489
|
holado_test/test_config.py,sha256=yQK2jNHEGltGc3fmsAgcsKN4y3_nuldZHD45XEMrsQA,1575
|
|
@@ -499,7 +499,7 @@ holado_test/common/context/feature_context.py,sha256=GhC0lihnvTBhv5tE4JzPt39eP7g
|
|
|
499
499
|
holado_test/common/context/scenario_context.py,sha256=x5q9AuBNkL9fG5LjiUzLOnqcyBLiOB_AlSPErKAcD1Y,7102
|
|
500
500
|
holado_test/common/context/step_context.py,sha256=j6S4ozTPrdlpV9Slopc998fYOV8KfMLAUSW4mcEFUI8,2383
|
|
501
501
|
holado_test/common/exceptions/undefined_step_exception.py,sha256=SHHX22iz4Ip-V4Y3aM2EJFDt30CCS5EaauN6KB-JORo,1461
|
|
502
|
-
holado_test/scenario/step_tools.py,sha256=
|
|
502
|
+
holado_test/scenario/step_tools.py,sha256=iNay6tQPUi4sG-a8PY5LbbLpX0PRakkOj3ls98aEbHM,26375
|
|
503
503
|
holado_test/scenario/tester_tools.py,sha256=Tv035FyXPjQ46Ep8KuPOjOvzJFvxnbv9EsrSihUzAwg,2479
|
|
504
504
|
holado_test/tests/behave/steps/__init__.py,sha256=rdqrp-UN7vRplIqORx4sXyKwMUkptRizyLWudsmYehM,1362
|
|
505
505
|
holado_test/tests/behave/steps/scenario/exception_steps.py,sha256=ZIE92Dz7a6O_c0jAP_0dj6Hc0tnW6YRgNKd4_aBpeR0,4054
|
|
@@ -529,7 +529,7 @@ holado_yaml/__init__.py,sha256=KpbIi2cm1BYZgoWf0LuhE0ei3ZCE15UcUtjC1cSA55M,1653
|
|
|
529
529
|
holado_yaml/tests/behave/steps/__init__.py,sha256=mXzHzGy9gkIDjYXdlxQ6BzaT4AfithgRmL_1sMxr63g,1272
|
|
530
530
|
holado_yaml/tests/behave/steps/yaml_steps.py,sha256=cxNgDywCopT_RCeqKiWfcJYyKZM3mlc39bAtGm2rgfc,8531
|
|
531
531
|
holado_yaml/yaml/enums.py,sha256=WD7mM_VhXtv8l0n08s6CSe7k2RUZDf_70mNCFsjjo94,1625
|
|
532
|
-
holado_yaml/yaml/yaml_client.py,sha256=
|
|
532
|
+
holado_yaml/yaml/yaml_client.py,sha256=sg0UEBD33MqiY-8CxlZT4mT_blkp5Z926vvQjkhiNFA,9288
|
|
533
533
|
holado_yaml/yaml/yaml_manager.py,sha256=iAg-WyXgHeIq_7WzYiVYE8G19Mcalqie8cD3_eyxogg,4363
|
|
534
534
|
holado_yaml/yaml/pyyaml/pyyaml_client.py,sha256=yZrx42Y3fGt6psBsLXTzMTWH30oiOfzsm5dVPkpJjQE,3086
|
|
535
535
|
holado_yaml/yaml/ruamel/ruamel_yaml_client.py,sha256=i4fJi-gbKJMfUPd3KfJPFaF7ZP6shMNfCPu8NPhAJVg,3201
|
|
@@ -655,7 +655,7 @@ test_holado/tools/django/api_rest/api_rest/api1/serializers.py,sha256=o_YxFr-tgC
|
|
|
655
655
|
test_holado/tools/django/api_rest/api_rest/api1/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
|
656
656
|
test_holado/tools/django/api_rest/api_rest/api1/views.py,sha256=kOt2xT6bxO47_z__5yYR9kcYIWWv4qYzpX0K8Tqonik,758
|
|
657
657
|
test_holado/tools/django/api_rest/api_rest/api1/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
658
|
-
holado-0.8.
|
|
659
|
-
holado-0.8.
|
|
660
|
-
holado-0.8.
|
|
661
|
-
holado-0.8.
|
|
658
|
+
holado-0.8.2.dist-info/METADATA,sha256=zWwgnlMfG4-_3ABtoVtk1fIB0DZNXW9Uq2qPI-2snwU,7671
|
|
659
|
+
holado-0.8.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
660
|
+
holado-0.8.2.dist-info/licenses/LICENSE,sha256=IgGmNlcFHnbp7UWrLJqAFvs_HIgjJDTmjCNRircJLsk,1070
|
|
661
|
+
holado-0.8.2.dist-info/RECORD,,
|
|
@@ -26,12 +26,12 @@ class DockerControllerClient(RestClient):
|
|
|
26
26
|
|
|
27
27
|
def get_environment_variable_value(self, var_name):
|
|
28
28
|
data = [var_name]
|
|
29
|
-
response = self.get(f"os/env",
|
|
29
|
+
response = self.get(f"os/env", json=data)
|
|
30
30
|
return self.response_result(response, status_ok=[200])
|
|
31
31
|
|
|
32
32
|
def get_directory_filenames(self, path):
|
|
33
33
|
data = {'path':path}
|
|
34
|
-
response = self.get(f"os/ls",
|
|
34
|
+
response = self.get(f"os/ls", json=data)
|
|
35
35
|
return self.response_result(response, status_ok=[200])
|
|
36
36
|
|
|
37
37
|
|
|
@@ -86,7 +86,7 @@ class DockerControllerClient(RestClient):
|
|
|
86
86
|
'with_backup': with_backup,
|
|
87
87
|
'backup_extension': backup_extension
|
|
88
88
|
}
|
|
89
|
-
response = self.patch(f"config/yaml_file",
|
|
89
|
+
response = self.patch(f"config/yaml_file", json=data)
|
|
90
90
|
return self.response_result(response, status_ok=[200,204])
|
|
91
91
|
|
|
92
92
|
def restore_yaml_file(self, file_path, backup_extension='.ha_bak'):
|
|
@@ -95,7 +95,7 @@ class DockerControllerClient(RestClient):
|
|
|
95
95
|
'file_path': file_path,
|
|
96
96
|
'backup_extension': backup_extension
|
|
97
97
|
}
|
|
98
|
-
response = self.put(f"config/yaml_file",
|
|
98
|
+
response = self.put(f"config/yaml_file", json=data)
|
|
99
99
|
return self.response_result(response, status_ok=[200,204])
|
|
100
100
|
|
|
101
101
|
|
|
@@ -18,8 +18,16 @@ def _get_session_context():
|
|
|
18
18
|
return SessionContext.instance()
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
class
|
|
21
|
+
class YamlFileView(MethodView):
|
|
22
22
|
|
|
23
|
+
def get(self, body: dict):
|
|
24
|
+
file_path = body['file_path']
|
|
25
|
+
|
|
26
|
+
with open(file_path, 'rt') as fin:
|
|
27
|
+
res = fin.read()
|
|
28
|
+
|
|
29
|
+
return res
|
|
30
|
+
|
|
23
31
|
def patch(self, body: dict):
|
|
24
32
|
file_path = body['file_path']
|
|
25
33
|
yaml_string = body['yaml_string']
|
|
@@ -186,6 +186,23 @@ paths:
|
|
|
186
186
|
type: "string"
|
|
187
187
|
|
|
188
188
|
/config/yaml_file:
|
|
189
|
+
get:
|
|
190
|
+
description: "Get content of a YAML file"
|
|
191
|
+
requestBody:
|
|
192
|
+
content:
|
|
193
|
+
application/json:
|
|
194
|
+
schema:
|
|
195
|
+
type: "object"
|
|
196
|
+
properties:
|
|
197
|
+
file_path:
|
|
198
|
+
type: string
|
|
199
|
+
responses:
|
|
200
|
+
200:
|
|
201
|
+
description: ""
|
|
202
|
+
content:
|
|
203
|
+
application/text:
|
|
204
|
+
schema:
|
|
205
|
+
type: "string"
|
|
189
206
|
patch:
|
|
190
207
|
description: "Update a YAML file"
|
|
191
208
|
requestBody:
|
|
@@ -211,7 +228,7 @@ paths:
|
|
|
211
228
|
application/json:
|
|
212
229
|
schema:
|
|
213
230
|
type: "string"
|
|
214
|
-
|
|
231
|
+
put:
|
|
215
232
|
description: "Replace a YAML file"
|
|
216
233
|
requestBody:
|
|
217
234
|
content:
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
MIIDZTCCAk2gAwIBAgIBKjANBgkqhkiG9w0BAQsFADCBizELMAkGA1UEBhMCVVMx
|
|
3
3
|
CzAJBgNVBAgMAkNBMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ8wDQYDVQQKDAZ0
|
|
4
4
|
Y3BiaW4xDDAKBgNVBAsMA29wczETMBEGA1UEAwwKdGNwYmluLmNvbTEjMCEGCSqG
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
FOLuMowBSAZfV5v82LmlaIIOvU/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
SIb3DQEJARYUaGFycnliYWdkaUBnbWFpbC5jb20wHhcNMjUwOTAxMTAxNDQ4WhcN
|
|
6
|
+
MjUwOTAyMTAxNDQ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q4k3+o9Nj/KYqncXzJ
|
|
26
|
+
v8GmSyjEtSy1VynW8D1VAtCbfI7GHa+TflcjLqKb2BN+BpTGjeVPRbXVUlwqFF3I
|
|
27
|
+
ughugjyndVciKdl7MmifCz92
|
|
28
28
|
-----END PRIVATE KEY-----
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
from holado.common.handlers.object import DeleteableObject
|
|
15
15
|
import os
|
|
16
16
|
from typing import AnyStr, List
|
|
17
|
+
from holado_python.standard_library.typing import Typing
|
|
18
|
+
from holado_core.common.exceptions.technical_exception import TechnicalException
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
class File(DeleteableObject):
|
|
@@ -33,7 +35,15 @@ class File(DeleteableObject):
|
|
|
33
35
|
|
|
34
36
|
def _delete_object(self):
|
|
35
37
|
self.close()
|
|
36
|
-
|
|
38
|
+
|
|
39
|
+
def __enter__(self):
|
|
40
|
+
if self.__file is None:
|
|
41
|
+
self.open()
|
|
42
|
+
return self
|
|
43
|
+
|
|
44
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
45
|
+
self.close()
|
|
46
|
+
|
|
37
47
|
@property
|
|
38
48
|
def path(self):
|
|
39
49
|
return self.__path
|
|
@@ -74,3 +84,36 @@ class File(DeleteableObject):
|
|
|
74
84
|
def readlines(self, hint: int = -1) -> List[AnyStr]:
|
|
75
85
|
return self.internal_file.readlines(hint)
|
|
76
86
|
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def get_file_content(cls, path, is_text_file=True):
|
|
91
|
+
mode = 'rt' if is_text_file else 'rb'
|
|
92
|
+
with File(path, mode=mode) as file:
|
|
93
|
+
res = file.read()
|
|
94
|
+
return res
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def get_file_content_in_base64(cls, path):
|
|
98
|
+
import base64
|
|
99
|
+
|
|
100
|
+
with File(path, mode="rb") as fin:
|
|
101
|
+
content = fin.read()
|
|
102
|
+
res = base64.b64encode(content)
|
|
103
|
+
|
|
104
|
+
return res
|
|
105
|
+
|
|
106
|
+
@classmethod
|
|
107
|
+
def create_file_with_content(cls, path, content):
|
|
108
|
+
if isinstance(content, str):
|
|
109
|
+
with File(path, mode='wt') as fout:
|
|
110
|
+
fout.write(content)
|
|
111
|
+
elif isinstance(content, bytes):
|
|
112
|
+
with File(path, mode='wb') as fout:
|
|
113
|
+
fout.write(content)
|
|
114
|
+
else:
|
|
115
|
+
raise TechnicalException(f"Unexpected content type {Typing.get_object_class_fullname(content)} (allowed types: str, bytes)")
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
@@ -88,8 +88,7 @@ def step_impl(context, var_name, path):
|
|
|
88
88
|
open_kwargs = ValueTableConverter.convert_name_value_table_2_dict(table)
|
|
89
89
|
|
|
90
90
|
__get_path_manager().makedirs(path)
|
|
91
|
-
res = File(path)
|
|
92
|
-
res.open(**open_kwargs)
|
|
91
|
+
res = File(path, **open_kwargs)
|
|
93
92
|
|
|
94
93
|
__get_variable_manager().register_variable(var_name, res)
|
|
95
94
|
|
|
@@ -125,25 +124,28 @@ def step_impl(context, var_name, is_text_file_str, path): # @DuplicatedSignatur
|
|
|
125
124
|
is_text_file = is_text_file_str is not None
|
|
126
125
|
path = StepTools.evaluate_scenario_parameter(path)
|
|
127
126
|
|
|
128
|
-
|
|
129
|
-
content = open(path, mode).read()
|
|
127
|
+
res = File.get_file_content(path, is_text_file)
|
|
130
128
|
|
|
131
|
-
__get_variable_manager().register_variable(var_name,
|
|
129
|
+
__get_variable_manager().register_variable(var_name, res)
|
|
132
130
|
|
|
133
131
|
@Given(r"(?P<var_name>{Variable}) = content of file (?P<path>{Str}) in base 64")
|
|
134
132
|
def step_impl(context, var_name, path): # @DuplicatedSignature
|
|
135
133
|
var_name = StepTools.evaluate_variable_name(var_name)
|
|
136
134
|
path = StepTools.evaluate_scenario_parameter(path)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
|
|
136
|
+
res = File.get_file_content_in_base64(path)
|
|
137
|
+
|
|
138
|
+
__get_variable_manager().register_variable(var_name, res)
|
|
140
139
|
|
|
141
140
|
@Given(r"(?P<var_name>{Variable}) = lines of file (?P<path>{Str})")
|
|
142
141
|
def step_impl(context, var_name, path): # @DuplicatedSignature
|
|
143
142
|
var_name = StepTools.evaluate_variable_name(var_name)
|
|
144
143
|
path = StepTools.evaluate_scenario_parameter(path)
|
|
145
|
-
|
|
144
|
+
|
|
145
|
+
with File(path, mode="r") as fin:
|
|
146
|
+
lines = fin.readlines()
|
|
146
147
|
res = list(map(lambda x: x.strip('\n'), lines))
|
|
148
|
+
|
|
147
149
|
__get_variable_manager().register_variable(var_name, res)
|
|
148
150
|
|
|
149
151
|
|
|
@@ -185,14 +187,7 @@ def step_impl(context, var_name, path_name, content):
|
|
|
185
187
|
file_path = os.path.join(dest_path, filename)
|
|
186
188
|
__get_path_manager().makedirs(file_path)
|
|
187
189
|
|
|
188
|
-
|
|
189
|
-
with open(file_path, 'wt') as fout:
|
|
190
|
-
fout.write(content)
|
|
191
|
-
elif isinstance(content, bytes):
|
|
192
|
-
with open(file_path, 'wb') as fout:
|
|
193
|
-
fout.write(content)
|
|
194
|
-
else:
|
|
195
|
-
raise TechnicalException(f"Unexpected content type {Typing.get_object_class_fullname(content)} (allowed types: string, bytes)")
|
|
190
|
+
File.create_file_with_content(file_path, content)
|
|
196
191
|
|
|
197
192
|
__get_variable_manager().register_variable(var_name, file_path)
|
|
198
193
|
|
|
@@ -398,6 +398,28 @@ class StepTools(object):
|
|
|
398
398
|
except FunctionalException as exc:
|
|
399
399
|
raise FunctionalException(f"Obtained table contains at least a row of expected table (obtained = table 1 ; expected = table 2):\n{Tools.indent_string(4, exc.message)}") from exc
|
|
400
400
|
|
|
401
|
+
@classmethod
|
|
402
|
+
def format_step(cls, step_str, keyword=None, table=None, text=None):
|
|
403
|
+
step_str = step_str.strip()
|
|
404
|
+
|
|
405
|
+
if keyword is not None:
|
|
406
|
+
res = f"{keyword} {step_str}"
|
|
407
|
+
else:
|
|
408
|
+
res = step_str
|
|
409
|
+
|
|
410
|
+
if table is not None:
|
|
411
|
+
if isinstance(table, Table):
|
|
412
|
+
rendered_table = table.represent(indent=4)
|
|
413
|
+
else:
|
|
414
|
+
raise TechnicalException(f"Unmanaged table of type '{Typing.get_object_class_fullname(table)}'")
|
|
415
|
+
res = u"{res}\n{table}".format(res=res, table=rendered_table)
|
|
416
|
+
elif text is not None:
|
|
417
|
+
rendered_text = text.replace(u'"""', u'\\"\\"\\"')
|
|
418
|
+
rendered_text = Tools.indent_string(4, u'"""\n' + rendered_text + '\n"""\n')
|
|
419
|
+
res = u"{res}\n{text}".format(res=res, text=rendered_text)
|
|
420
|
+
|
|
421
|
+
return res
|
|
422
|
+
|
|
401
423
|
@classmethod
|
|
402
424
|
def format_steps_with(cls, steps, format_with_list):
|
|
403
425
|
res = steps
|
holado_yaml/yaml/yaml_client.py
CHANGED
|
@@ -104,16 +104,24 @@ class YAMLClient(Object):
|
|
|
104
104
|
|
|
105
105
|
# Update file
|
|
106
106
|
dst_data = self.load_file(file_path)
|
|
107
|
-
|
|
107
|
+
if dst_data is None:
|
|
108
|
+
dst_data = data
|
|
109
|
+
else:
|
|
110
|
+
self.update_data(dst_data, data, update_type)
|
|
108
111
|
self.save_in_file(file_path, dst_data, **kwargs) # Note: as file already exists, it is not needed to pass parameters mode, user and group
|
|
109
112
|
|
|
110
113
|
def update_string(self, text, data, update_type=UpdateType.AddOrUpdate, **kwargs):
|
|
111
114
|
dst_data = self.load_string(text)
|
|
112
|
-
|
|
115
|
+
if dst_data is None:
|
|
116
|
+
dst_data = data
|
|
117
|
+
else:
|
|
118
|
+
self.update_data(dst_data, data, update_type)
|
|
113
119
|
res = self.save_in_string(dst_data, **kwargs)
|
|
114
120
|
return res
|
|
115
121
|
|
|
116
122
|
def update_data(self, dst, src, update_type=UpdateType.AddOrUpdate):
|
|
123
|
+
if dst is None:
|
|
124
|
+
raise TechnicalException("Destination data cannot be None")
|
|
117
125
|
if isinstance(src, str):
|
|
118
126
|
src = self.load_string(src)
|
|
119
127
|
|
|
File without changes
|
|
File without changes
|