holado 0.2.8__py3-none-any.whl → 0.4.0__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.

Files changed (110) hide show
  1. holado/common/handlers/undefined.py +7 -1
  2. {holado-0.2.8.dist-info → holado-0.4.0.dist-info}/METADATA +4 -1
  3. {holado-0.2.8.dist-info → holado-0.4.0.dist-info}/RECORD +108 -101
  4. holado_ais/ais/ais_messages.py +97 -6
  5. holado_ais/tests/behave/steps/ais/ais_manager_steps.py +1 -1
  6. holado_ais/tests/behave/steps/ais/ais_messages_steps.py +45 -6
  7. holado_binary/ipc/bit_series.py +3 -3
  8. holado_binary/tests/behave/steps/ipc/binary_steps.py +1 -1
  9. holado_binary/tests/behave/steps/ipc/bit_series_steps.py +4 -3
  10. holado_context/tests/behave/steps/private/common/context_steps.py +1 -1
  11. holado_core/common/resource/persisted_data_manager.py +13 -16
  12. holado_core/common/resource/resource_manager.py +10 -10
  13. holado_core/common/tables/converters/table_converter.py +47 -9
  14. holado_core/common/tables/table_manager.py +6 -7
  15. holado_core/common/tables/table_with_header.py +6 -0
  16. holado_core/tests/behave/steps/common/common_steps.py +2 -1
  17. holado_core/tests/behave/steps/common/config_steps.py +1 -1
  18. holado_core/tests/behave/steps/common/resource_steps.py +1 -1
  19. holado_core/tests/behave/steps/common/tables_steps.py +18 -2
  20. holado_data/data/generator/generator_manager.py +39 -0
  21. holado_data/tests/behave/steps/data/generator_steps.py +1 -1
  22. holado_data/tests/behave/steps/tools/utils_steps.py +1 -2
  23. holado_db/tests/behave/steps/tools/db/db_client_steps.py +1 -1
  24. holado_db/tests/behave/steps/tools/db/postgresql_client_steps.py +1 -1
  25. holado_db/tests/behave/steps/tools/db/sqlite_client_steps.py +1 -1
  26. holado_db/tools/db/clients/base/db_client.py +81 -28
  27. holado_db/tools/db/clients/postgresql/postgresql_client.py +17 -7
  28. holado_db/tools/db/query/base/query_builder.py +58 -7
  29. holado_db/tools/db/query/pypika/pypika_query_builder.py +73 -21
  30. holado_docker/tests/behave/steps/tools/docker_steps.py +1 -1
  31. holado_grpc/tests/behave/steps/api/grpc_client_steps.py +1 -1
  32. holado_grpc/tests/behave/steps/private/api/grpc_steps.py +1 -1
  33. holado_json/tests/behave/steps/ipc/json_steps.py +1 -1
  34. holado_keycloak/tests/behave/steps/tools/keycloak_client_steps.py +1 -1
  35. holado_multitask/tests/behave/steps/multiprocessing_steps.py +1 -1
  36. holado_multitask/tests/behave/steps/multithreading_steps.py +1 -1
  37. holado_protobuf/ipc/protobuf/types/google/protobuf.py +1 -1
  38. holado_protobuf/tests/behave/steps/ipc/protobuf_steps.py +1 -1
  39. holado_python/common/tools/datetime.py +31 -12
  40. holado_python/standard_library/socket/blocking_socket.py +37 -24
  41. holado_python/standard_library/socket/message_socket.py +11 -3
  42. holado_python/standard_library/socket/non_blocking_socket.py +24 -24
  43. holado_python/standard_library/socket/socket.py +132 -19
  44. holado_python/standard_library/ssl/resources/certificates/NOTES.txt +1 -1
  45. holado_python/standard_library/ssl/resources/certificates/rootCACert.pem +24 -0
  46. holado_python/standard_library/ssl/resources/certificates/tcpbin.crt +21 -0
  47. holado_python/standard_library/ssl/resources/certificates/tcpbin.key +28 -0
  48. holado_python/standard_library/ssl/ssl.py +138 -21
  49. holado_python/tests/behave/steps/convert_steps.py +1 -1
  50. holado_python/tests/behave/steps/iterable_steps.py +1 -1
  51. holado_python/tests/behave/steps/standard_library/csv_steps.py +1 -1
  52. holado_python/tests/behave/steps/standard_library/datetime_steps.py +1 -1
  53. holado_python/tests/behave/steps/standard_library/hashlib_steps.py +2 -2
  54. holado_python/tests/behave/steps/standard_library/multiprocessing_steps.py +1 -1
  55. holado_python/tests/behave/steps/standard_library/queue_steps.py +1 -1
  56. holado_python/tests/behave/steps/standard_library/socket_steps.py +132 -18
  57. holado_python/tests/behave/steps/standard_library/ssl_steps.py +87 -16
  58. holado_rabbitmq/tests/behave/steps/tools/rabbitmq_client_steps.py +48 -20
  59. holado_rabbitmq/tests/behave/steps/tools/rabbitmq_server_steps.py +1 -1
  60. holado_rabbitmq/tools/rabbitmq/rabbitmq_client.py +19 -13
  61. holado_rabbitmq/tools/rabbitmq/rabbitmq_manager.py +2 -29
  62. holado_redis/tests/behave/steps/tools/redis_client_steps.py +1 -1
  63. holado_rest/api/rest/rest_client.py +18 -1
  64. holado_rest/api/rest/rest_manager.py +5 -0
  65. holado_rest/tests/behave/steps/api/rest_client_steps.py +52 -11
  66. holado_rest/tests/behave/steps/private/api/rest_steps.py +1 -1
  67. holado_s3/tests/behave/steps/private/tools/s3_steps.py +1 -1
  68. holado_s3/tests/behave/steps/tools/s3_client_steps.py +1 -1
  69. holado_s3/tests/behave/steps/tools/s3_server_steps.py +1 -1
  70. holado_scripting/tests/behave/steps/common/tools/variable_convert_steps.py +3 -2
  71. holado_scripting/tests/behave/steps/common/tools/variable_new_steps.py +1 -1
  72. holado_scripting/tests/behave/steps/common/tools/variable_steps.py +1 -1
  73. holado_scripting/tests/behave/steps/common/tools/variable_verify_steps.py +1 -1
  74. holado_scripting/tests/behave/steps/scenario/function_steps.py +1 -1
  75. holado_scripting/tests/behave/steps/scenario/if_steps.py +1 -1
  76. holado_scripting/tests/behave/steps/scenario/loop_steps.py +1 -1
  77. holado_sftp/tests/behave/steps/private/tools/sftp_steps.py +1 -1
  78. holado_sftp/tests/behave/steps/tools/sftp_client_steps.py +1 -1
  79. holado_sftp/tests/behave/steps/tools/sftp_server_steps.py +1 -1
  80. holado_swagger/tests/behave/steps/swagger_hub/mockserver_steps.py +1 -1
  81. holado_system/system/command/command.py +14 -9
  82. holado_system/tests/behave/steps/system/commands_steps.py +1 -1
  83. holado_system/tests/behave/steps/system/file_steps.py +1 -1
  84. holado_system/tests/behave/steps/system/system_steps.py +1 -1
  85. holado_test/scenario/step_tools.py +1 -1
  86. holado_test/scenario/tester_tools.py +6 -3
  87. holado_test/tests/behave/steps/scenario/exception_steps.py +1 -1
  88. holado_test/tests/behave/steps/scenario/scenario_steps.py +1 -1
  89. holado_test/tests/behave/steps/scenario/tester_steps.py +4 -4
  90. holado_value/common/tables/converters/value_table_converter.py +52 -8
  91. holado_value/common/tables/value_table_manager.py +0 -10
  92. holado_ws/tests/behave/steps/api/web_service_steps.py +1 -1
  93. holado_yaml/tests/behave/steps/yaml_steps.py +1 -1
  94. holado_yaml/yaml/yaml_manager.py +2 -2
  95. test_holado/features/NonReg/common/tables/table.feature +30 -24
  96. test_holado/features/NonReg/holado_ais/ais_message-bitarray_to_nmea.feature +1 -1
  97. test_holado/features/NonReg/holado_python/standard_library/socket/local_echo_server/socket_reset.feature +191 -0
  98. test_holado/features/NonReg/holado_python/standard_library/{socket_with_ssl.feature → socket/local_echo_server/socket_with_tls_and_verify.feature} +53 -30
  99. test_holado/features/NonReg/holado_python/standard_library/socket/local_echo_server/socket_with_tls_without_verify.feature +299 -0
  100. test_holado/features/NonReg/holado_python/standard_library/{socket.feature → socket/local_echo_server/socket_without_tls.feature} +2 -2
  101. test_holado/features/NonReg/holado_python/standard_library/socket/tcpbin.com/socket_with_mtls.feature +214 -0
  102. test_holado/features/NonReg/holado_python/standard_library/socket/tcpbin.com/socket_with_tls.feature +184 -0
  103. test_holado/features/NonReg/holado_python/standard_library/socket/tcpbin.com/socket_without_tls.feature +169 -0
  104. test_holado/features/NonReg/tools/RabbitMQ.feature +9 -9
  105. test_holado/features/NonReg/tools/RabbitMQ_steps.feature +8 -8
  106. test_holado/logging.conf +5 -3
  107. holado_core/common/transport/__init__.py +0 -0
  108. holado_core/common/transport/crc.py +0 -40
  109. {holado-0.2.8.dist-info → holado-0.4.0.dist-info}/WHEEL +0 -0
  110. {holado-0.2.8.dist-info → holado-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -16,7 +16,7 @@
16
16
  from holado_value.common.tables.value_table_manager import ValueTableManager
17
17
  from holado_test.scenario.step_tools import StepTools
18
18
  from holado.common.context.session_context import SessionContext
19
- from holado_test.behave.behave import *
19
+ from holado_test.behave.behave import * # @UnusedWildImport
20
20
  import logging
21
21
  from holado_core.common.exceptions.functional_exception import FunctionalException
22
22
  from holado_test.behave.scenario.behave_step_tools import BehaveStepTools
@@ -15,7 +15,7 @@
15
15
 
16
16
  from holado_test.scenario.step_tools import StepTools
17
17
  from holado.common.context.session_context import SessionContext
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  from holado_core.common.exceptions.technical_exception import TechnicalException
20
20
  import logging
21
21
  import copy
@@ -15,7 +15,7 @@
15
15
 
16
16
  from holado_test.scenario.step_tools import StepTools
17
17
  from holado.common.context.session_context import SessionContext
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  from holado_core.common.tables.table_manager import TableManager
20
20
  from holado_value.common.tables.comparators.table_2_value_table_comparator import Table2ValueTable_Comparator
21
21
  from holado_core.common.tools.comparators.comparator import CompareOperator
@@ -15,7 +15,7 @@
15
15
  import logging
16
16
  from holado.common.context.session_context import SessionContext
17
17
  from holado_test.scenario.step_tools import StepTools
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  from holado_core.common.block.scope_steps import ScopeSteps
20
20
  from holado_core.common.tools.tools import Tools
21
21
 
@@ -15,7 +15,7 @@
15
15
  import logging
16
16
  from holado.common.context.session_context import SessionContext
17
17
  from holado_core.common.exceptions.functional_exception import FunctionalException
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  from holado_core.common.tools.converters.converter import Converter
20
20
  from holado_python.standard_library.typing import Typing
21
21
 
@@ -15,7 +15,7 @@
15
15
  import logging
16
16
  from holado.common.context.session_context import SessionContext
17
17
  from holado_test.scenario.step_tools import StepTools
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  from holado_core.common.block.scope_steps import ScopeForSteps, ScopeWhileSteps
20
20
  from holado_core.common.exceptions.technical_exception import TechnicalException
21
21
 
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
  from holado.common.context.session_context import SessionContext
17
- from holado_test.behave.behave import *
17
+ from holado_test.behave.behave import * # @UnusedWildImport
18
18
  import os.path
19
19
  import logging
20
20
  from holado_test.scenario.step_tools import StepTools
@@ -15,7 +15,7 @@
15
15
 
16
16
  from holado_test.scenario.step_tools import StepTools
17
17
  from holado.common.context.session_context import SessionContext
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  from holado_core.common.exceptions.functional_exception import FunctionalException
20
20
  from holado_sftp.tools.sftp.sftp_client import SFTPClient
21
21
  from holado_core.common.exceptions.technical_exception import TechnicalException
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
  from holado.common.context.session_context import SessionContext
17
- from holado_test.behave.behave import *
17
+ from holado_test.behave.behave import * # @UnusedWildImport
18
18
  from holado_sftp.tools.sftp.sftp_server import SFTPServer
19
19
  from holado_core.common.exceptions.functional_exception import FunctionalException
20
20
  import logging
@@ -15,7 +15,7 @@
15
15
 
16
16
  from holado_test.scenario.step_tools import StepTools
17
17
  from holado.common.context.session_context import SessionContext
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  from holado_core.common.exceptions.technical_exception import TechnicalException
20
20
  from holado_rest.api.rest.rest_client import RestClient
21
21
  import json
@@ -19,6 +19,7 @@ import logging
19
19
  import time
20
20
  from enum import IntEnum
21
21
  from holado_core.common.exceptions.functional_exception import FunctionalException
22
+ import copy
22
23
 
23
24
  logger = logging.getLogger(__name__)
24
25
 
@@ -35,7 +36,7 @@ class Command(threading.Thread):
35
36
  Execute a command in a thread.
36
37
  """
37
38
 
38
- def __init__(self, cmd, do_log_output = False, do_raise_on_stderr = False):
39
+ def __init__(self, cmd, do_log_output = False, do_raise_on_stderr = False, **subprocess_kwargs):
39
40
  """
40
41
  'cmd' argument can be a list or a str. If the global command should contain a '"' in any argument, it is recommanded to pass 'cmd' as a str.
41
42
  """
@@ -56,6 +57,7 @@ class Command(threading.Thread):
56
57
  self.__callback = None
57
58
  self.__callback_delay_ms = None
58
59
  self.__external_parameters = {}
60
+ self.__subprocess_kwargs = subprocess_kwargs
59
61
 
60
62
 
61
63
  @property
@@ -119,18 +121,21 @@ class Command(threading.Thread):
119
121
  logger.debug("Call command: {}".format(self.cmd))
120
122
  try:
121
123
  self.__state = CommandStates.Running
124
+
125
+ kwargs = copy.copy(self.__subprocess_kwargs)
126
+ kwargs['universal_newlines'] = True
122
127
  if isinstance(self.cmd, str):
123
128
  self.__process = subprocess.Popen(self.cmd,
124
- stdout=subprocess.PIPE,
125
- stderr=subprocess.PIPE,
126
- shell=True,
127
- universal_newlines=True)
129
+ stdout=subprocess.PIPE,
130
+ stderr=subprocess.PIPE,
131
+ shell=True,
132
+ **kwargs)
128
133
  else:
129
134
  self.__process = subprocess.Popen(self.cmd,
130
- stdout=subprocess.PIPE,
131
- stderr=subprocess.PIPE,
132
- shell=False,
133
- universal_newlines=True)
135
+ stdout=subprocess.PIPE,
136
+ stderr=subprocess.PIPE,
137
+ shell=False,
138
+ **kwargs)
134
139
 
135
140
  self.__stdout = ""
136
141
  self.__stderr = ""
@@ -6,7 +6,7 @@ from holado_system.system.command.command import Command, CommandStates
6
6
  from holado_core.common.exceptions.functional_exception import FunctionalException
7
7
  from holado_test.scenario.step_tools import StepTools
8
8
  from holado_core.tools.abstracts.blocking_command_service import BlockingCommandService
9
- from holado_test.behave.behave import *
9
+ from holado_test.behave.behave import * # @UnusedWildImport
10
10
  from holado_core.common.exceptions.technical_exception import TechnicalException
11
11
  from holado_test.behave.scenario.behave_step_tools import BehaveStepTools
12
12
  from holado_value.common.tables.converters.value_table_converter import ValueTableConverter
@@ -15,7 +15,7 @@
15
15
 
16
16
  from holado_test.scenario.step_tools import StepTools
17
17
  from holado.common.context.session_context import SessionContext
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  import logging
20
20
  from holado_test.behave.scenario.behave_step_tools import BehaveStepTools
21
21
  from holado_value.common.tables.converters.value_table_converter import ValueTableConverter
@@ -15,7 +15,7 @@
15
15
 
16
16
  from holado_test.scenario.step_tools import StepTools
17
17
  from holado.common.context.session_context import SessionContext
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  import tempfile
20
20
  import logging
21
21
  import os
@@ -303,7 +303,7 @@ class StepTools(object):
303
303
 
304
304
  for cell in internal_header:
305
305
  scell = ValueTableCell(cell)
306
- if not ( scell.content_type == ValueTypes.Symbol and scell.value_type == ValueTypes.String ):
306
+ if not scell.content_type == ValueTypes.Symbol:
307
307
  return False
308
308
 
309
309
  return True
@@ -37,11 +37,14 @@ class TesterTools(object):
37
37
  return SessionContext.instance().report_manager
38
38
 
39
39
  @classmethod
40
- def log(cls, msg):
40
+ def log(cls, msg, unlimited=False):
41
41
  cls.__configure_logger()
42
42
 
43
- # logger.info(msg)
44
- logger.print(msg)
43
+ if unlimited:
44
+ logger.print(msg, msg_size_limit=-1)
45
+ else:
46
+ # logger.info(msg)
47
+ logger.print(msg)
45
48
 
46
49
  @classmethod
47
50
  def represent(cls, obj):
@@ -16,7 +16,7 @@ import logging
16
16
  from holado.common.context.session_context import SessionContext
17
17
  from holado_core.common.exceptions.functional_exception import FunctionalException
18
18
  from holado_test.scenario.step_tools import StepTools
19
- from holado_test.behave.behave import *
19
+ from holado_test.behave.behave import * # @UnusedWildImport
20
20
  from holado_test.behave.behave import enter_expected_exception_step
21
21
  from holado_test.behave.scenario.behave_step_tools import BehaveStepTools
22
22
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  import logging
16
16
  from holado.common.context.session_context import SessionContext
17
- from holado_test.behave.behave import *
17
+ from holado_test.behave.behave import * # @UnusedWildImport
18
18
  from holado_core.common.block.function import Function
19
19
  from holado_test.common.context.scenario_context import ScenarioContext
20
20
  from holado_test.behave.scenario.behave_step_tools import BehaveStepTools
@@ -15,7 +15,7 @@
15
15
 
16
16
  from holado_test.scenario.step_tools import StepTools
17
17
  from holado.common.context.session_context import SessionContext
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  import logging
20
20
  from holado_test.behave.scenario.behave_step_tools import BehaveStepTools
21
21
  from holado_core.common.exceptions.functional_exception import FunctionalException
@@ -31,8 +31,8 @@ def __get_variable_manager():
31
31
  return __get_scenario_context().get_variable_manager()
32
32
 
33
33
 
34
- @Step(r"tester logs (?P<msg>{AnyStr})")
35
- def step_impl(context, msg):
34
+ @Step(r"tester logs (?P<msg>{AnyStr})(?: \((?P<unlimited_str>unlimited)\))?")
35
+ def step_impl(context, msg, unlimited_str):
36
36
  msg = StepTools.evaluate_scenario_parameter(msg)
37
37
 
38
38
  # Add multiline text if present
@@ -45,7 +45,7 @@ def step_impl(context, msg):
45
45
  if table:
46
46
  msg += '\n' + table.represent(4)
47
47
 
48
- TesterTools.log(msg)
48
+ TesterTools.log(msg, unlimited_str is not None)
49
49
 
50
50
 
51
51
  @Step(r"(?P<var_name>{Variable}) = tester represents (?P<param>{Any})")
@@ -27,6 +27,7 @@ from holado_value.common.tools.value_types import ValueTypes
27
27
  from holado_core.common.tools.tools import Tools
28
28
  from holado_json.ipc.json_converter import JsonConverter
29
29
  from holado_python.standard_library.typing import Typing
30
+ from holado_data.data.generator.base import BaseGenerator
30
31
 
31
32
  logger = logging.getLogger(__name__)
32
33
 
@@ -67,15 +68,58 @@ class ValueTableConverter(TableConverter):
67
68
  return res
68
69
 
69
70
  @classmethod
70
- def convert_table_with_header_to_dict_list(cls, table):
71
- index_by_name = table.get_column_indexes_by_string_content()
72
-
73
- res = []
74
- for row in table.rows:
75
- new_dict = {name: row.get_cell(index).value for name, index in index_by_name.items()}
76
- res.append(new_dict)
71
+ def convert_table_with_header_to_dict_list(cls, table, as_generator=False):
72
+ if not ValueTableManager.is_value_table(table):
73
+ return TableConverter.convert_table_with_header_to_dict_list(table, as_generator=as_generator)
74
+
75
+ if as_generator:
76
+ class TableWithHeader2DictGenerator(BaseGenerator):
77
+ def __init__(self, table):
78
+ super().__init__(name="table with header to dict generator")
79
+ self.__table = table
80
+ self.__index_by_name = table.get_column_indexes_by_string_content()
81
+ self.__table_rows_iter = iter(self.__table.rows)
82
+
83
+ def __next__(self):
84
+ row = next(self.__table_rows_iter)
85
+ return {name: row.get_cell(index).value for name, index in self.__index_by_name.items()}
77
86
 
78
- return res
87
+ return TableWithHeader2DictGenerator(table)
88
+ else:
89
+ # index_by_name = table.get_column_indexes_by_string_content()
90
+ #
91
+ # res = []
92
+ # for row in table.rows:
93
+ # new_dict = {name: row.get_cell(index).value for name, index in index_by_name.items()}
94
+ # res.append(new_dict)
95
+ #
96
+ # return res
97
+ gen = cls.convert_table_with_header_to_dict_list(table, as_generator=True)
98
+ return [e for e in gen]
99
+
100
+ @classmethod
101
+ def convert_table_2_list_of_tuples(cls, table, as_generator=False):
102
+ if not ValueTableManager.is_value_table(table):
103
+ return TableConverter.convert_table_2_list_of_tuples(table, as_generator=as_generator)
104
+
105
+ if Tools.do_log(logger, logging.DEBUG):
106
+ logger.debug("Converting table to a list of tuples...")
107
+ if as_generator:
108
+ class Table2TupleGenerator(BaseGenerator):
109
+ def __init__(self, table):
110
+ super().__init__(name="table with header to dict generator")
111
+ self.__table = table
112
+ self.__table_rows_iter = iter(self.__table.rows)
113
+
114
+ def __next__(self):
115
+ row = next(self.__table_rows_iter)
116
+ return tuple((cell.value for cell in row.cells))
117
+
118
+ return Table2TupleGenerator(table)
119
+ else:
120
+ # return [tuple((cell.content for cell in row.cells)) for row in table.rows]
121
+ gen = cls.convert_table_2_list_of_tuples(table, as_generator=True)
122
+ return [e for e in gen]
79
123
 
80
124
  @classmethod
81
125
  def convert_name_value_table_2_dict(cls, table, with_original_value_content = False):
@@ -35,16 +35,6 @@ class ValueTableManager(TableManager):
35
35
  raise VerifyException(f"Table is not a ValueTable of ValueTableWithHeader (table type: {type(table)})")
36
36
  return res
37
37
 
38
- @classmethod
39
- def convert_table_2_list_of_tuples(cls, table):
40
- if isinstance(table, ValueTable) or isinstance(table, ValueTableWithHeader):
41
- if Tools.do_log(logger, logging.DEBUG):
42
- logger.debug("Converting value table to a list of tuples...")
43
- return [tuple((cell.value for cell in row.cells)) for row in table.rows]
44
- else:
45
- return TableManager.convert_table_2_list_of_tuples(table)
46
-
47
-
48
38
  @classmethod
49
39
  def set_object_attributes_according_name_value_table(cls, obj, table):
50
40
  if not cls.is_value_table(table):
@@ -22,7 +22,7 @@ from holado_value.common.tables.value_table_manager import ValueTableManager
22
22
  from holado.common.context.session_context import SessionContext
23
23
  from holado_core.common.exceptions.functional_exception import FunctionalException
24
24
  from holado_core.common.exceptions.technical_exception import TechnicalException
25
- from holado_test.behave.behave import *
25
+ from holado_test.behave.behave import * # @UnusedWildImport
26
26
  from holado_test.behave.scenario.behave_step_tools import BehaveStepTools
27
27
  from holado_value.common.tables.converters.value_table_converter import ValueTableConverter
28
28
  from holado_test.scenario.step_tools import StepTools
@@ -15,7 +15,7 @@
15
15
 
16
16
  from holado_test.scenario.step_tools import StepTools
17
17
  from holado.common.context.session_context import SessionContext
18
- from holado_test.behave.behave import *
18
+ from holado_test.behave.behave import * # @UnusedWildImport
19
19
  import logging
20
20
  from holado_yaml.yaml.yaml_manager import YAMLManager
21
21
 
@@ -39,7 +39,7 @@ class YAMLManager(object):
39
39
  return with_yaml
40
40
 
41
41
  @classmethod
42
- def __path_manager(cls):
42
+ def __get_path_manager(cls):
43
43
  return SessionContext.instance().path_manager
44
44
 
45
45
  @classmethod
@@ -78,7 +78,7 @@ class YAMLManager(object):
78
78
 
79
79
  @classmethod
80
80
  def save_file(cls, data, file_path):
81
- cls.__path_manager().makedirs(file_path)
81
+ cls.__get_path_manager().makedirs(file_path)
82
82
  with open(file_path, 'w') as file:
83
83
  yaml.dump(data, file)
84
84
 
@@ -10,37 +10,37 @@ Feature: Features related to tables
10
10
 
11
11
  Given end preconditions
12
12
  ### PRECONDITIONS - END
13
-
14
- Then table INPUT_TABLE is
13
+
14
+ Then table INPUT_TABLE is
15
15
  | Name | Value |
16
16
  | 'test1' | 1 |
17
17
  | 'test2' | 2.0 |
18
18
  | 'test3' | 'test3' |
19
19
  | 'test4' | None |
20
20
 
21
- Given EXTRACTED = extract column 'Name' from table INPUT_TABLE
22
- Then table EXTRACTED is
23
- | Name |
24
- | 'test1' |
25
- | 'test2' |
26
- | 'test3' |
27
- | 'test4' |
21
+ Given EXTRACTED = extract column 'Name' from table INPUT_TABLE
22
+ Then table EXTRACTED is
23
+ | Name |
24
+ | 'test1' |
25
+ | 'test2' |
26
+ | 'test3' |
27
+ | 'test4' |
28
28
 
29
- Given EXTRACTED = extract column 'Value' cells from table INPUT_TABLE
30
- Then table EXTRACTED is
31
- | 1 |
32
- | 2.0 |
33
- | 'test3' |
29
+ Given EXTRACTED = extract column 'Value' cells from table INPUT_TABLE
30
+ Then table EXTRACTED is
31
+ | 1 |
32
+ | 2.0 |
33
+ | 'test3' |
34
34
  | None |
35
35
 
36
- Given EXTRACTED = extract column 'Value' cells from table INPUT_TABLE as row
37
- Then table EXTRACTED is
38
- | 1 | 2.0 | 'test3' | None |
36
+ Given EXTRACTED = extract column 'Value' cells from table INPUT_TABLE as row
37
+ Then table EXTRACTED is
38
+ | 1 | 2.0 | 'test3' | None |
39
39
 
40
40
  Scenario: Empty table
41
41
  ### PRECONDITIONS - BEGIN
42
42
  Given begin preconditions
43
-
43
+
44
44
  Given INPUT_TABLE = convert json '{}' to name/value table with names uncollapsed
45
45
  Then table INPUT_TABLE is
46
46
  | Name | Value |
@@ -53,7 +53,7 @@ Feature: Features related to tables
53
53
  Scenario: Table count
54
54
  ### PRECONDITIONS - BEGIN
55
55
  Given begin preconditions
56
-
56
+
57
57
  Given INPUT_TABLE = convert json '{"test1" : 1, "test2":2.0, "test3": "test3", "test4" : null}' to name/value table with names uncollapsed
58
58
 
59
59
  Then table INPUT_TABLE is
@@ -67,7 +67,7 @@ Feature: Features related to tables
67
67
  ### PRECONDITIONS - END
68
68
 
69
69
  Given TABLE_COUNT = number of rows in table INPUT_TABLE
70
- Then TABLE_COUNT == 4
70
+ Then TABLE_COUNT == 4
71
71
 
72
72
 
73
73
  Scenario: Table count empty
@@ -82,12 +82,13 @@ Feature: Features related to tables
82
82
  Given TABLE_COUNT = number of rows in table INPUT_TABLE
83
83
  Then TABLE_COUNT == 0
84
84
 
85
-
85
+ @table_is
86
86
  Scenario: Table verification and variables
87
87
  ### PRECONDITIONS - BEGIN
88
88
  Given begin preconditions
89
-
90
- Given INPUT_TABLE = convert json '{"test1" : 1, "test2":2.0, "test3": "TEST3 value", "test4" : null}' to name/value table with names uncollapsed
89
+
90
+ Given TABLE_1 = convert json '{"test1" : 1, "test2":2.0, "test3": "TEST3 value", "test4" : null}' to name/value table with names uncollapsed
91
+ Given TABLE_2 = convert json '{"TEST1" : 1, "TEST2":2.0, "TEST3": "TEST3 value", "TEST4" : null}' to table with names as columns
91
92
 
92
93
  Given TEST3 = 'test3'
93
94
  Given TEST3_VALUE = 'TEST3 value'
@@ -95,13 +96,18 @@ Feature: Features related to tables
95
96
  Given end preconditions
96
97
  ### PRECONDITIONS - END
97
98
 
98
- Then table INPUT_TABLE is
99
+ Then table TABLE_1 is
99
100
  | Name | Value |
100
101
  | 'test1' | 1 |
101
102
  | 'test2' | 2.0 |
102
103
  | ${TEST3} | ${TEST3_VALUE} |
103
104
  | 'test4' | None |
104
105
 
106
+ Then table TABLE_2 is
107
+ | TEST1 | TEST2 | TEST3 | TEST4 |
108
+ | 1 | 2.0 | ${TEST3_VALUE} | None |
109
+
110
+
105
111
  @table_without_rows
106
112
  Scenario: Table without rows
107
113
  ### PRECONDITIONS - BEGIN
@@ -52,7 +52,7 @@ Feature: Test decode of AIS message from bitarry and its encode in NMEAv4
52
52
  Scenario Outline: from NMEAv4 sentences to bitarray through decode
53
53
 
54
54
  Given NMEA_SENTENCES = split text <msg_nmea> on separator '\n'
55
- When MSG = decode AIS NMEA message NMEA_SENTENCES
55
+ When MSG = decode NMEA AIS message NMEA_SENTENCES
56
56
  Then MSG.mmsi == <mmsi>
57
57
 
58
58
  When MSG_RAW = convert AIS message MSG to hexadecimal string