holado 0.2.6__py3-none-any.whl → 0.2.8__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-0.2.6.dist-info → holado-0.2.8.dist-info}/METADATA +4 -1
- {holado-0.2.6.dist-info → holado-0.2.8.dist-info}/RECORD +27 -25
- holado_core/common/resource/persisted_method_to_call_manager.py +16 -3
- holado_core/common/tables/table.py +2 -2
- holado_core/common/tools/string_tools.py +9 -0
- holado_core/common/tools/tools.py +2 -2
- holado_core/tests/behave/steps/common/tables_steps.py +10 -3
- holado_helper/script/action.py +16 -7
- holado_python/standard_library/socket/blocking_socket.py +86 -29
- holado_python/standard_library/socket/echo_server.py +4 -3
- holado_python/standard_library/socket/message_socket.py +59 -20
- holado_python/standard_library/socket/non_blocking_socket.py +58 -60
- holado_python/standard_library/socket/socket.py +149 -22
- holado_python/tests/behave/steps/standard_library/socket_steps.py +15 -3
- holado_python/tests/behave/steps/standard_library/ssl_steps.py +1 -1
- holado_scripting/text/interpreter/functions/function_apply_function.py +60 -0
- holado_scripting/text/interpreter/functions/function_to_string.py +50 -0
- holado_scripting/text/interpreter/text_interpreter.py +4 -0
- holado_test/scenario/step_tools.py +4 -3
- holado_value/common/tables/comparators/table_2_value_table_cell_comparator.py +2 -1
- holado_value/common/tables/value_table_cell.py +5 -0
- holado_value/common/tables/value_table_row.py +0 -1
- holado_value/common/tools/value.py +6 -2
- test_holado/features/NonReg/holado_python/standard_library/socket.feature +62 -0
- test_holado/features/NonReg/holado_python/standard_library/socket_with_ssl.feature +77 -1
- {holado-0.2.6.dist-info → holado-0.2.8.dist-info}/WHEEL +0 -0
- {holado-0.2.6.dist-info → holado-0.2.8.dist-info}/licenses/LICENSE +0 -0
|
@@ -16,7 +16,6 @@ from holado_value.common.tables.value_table_cell import ValueTableCell
|
|
|
16
16
|
from holado_core.common.tables.table_row import TableRow
|
|
17
17
|
import logging
|
|
18
18
|
from holado_core.common.tools.tools import Tools
|
|
19
|
-
from holado_python.standard_library.typing import Typing
|
|
20
19
|
from holado.common.handlers.undefined import undefined_value
|
|
21
20
|
|
|
22
21
|
logger = logging.getLogger(__name__)
|
|
@@ -49,7 +49,7 @@ class Value(object):
|
|
|
49
49
|
|
|
50
50
|
self.__extract_value_information(original_value, value)
|
|
51
51
|
if Tools.do_log(logger, logging.TRACE): # @UndefinedVariable
|
|
52
|
-
logger.trace(f"New Value: original_value=[{self.__original_value}] ; type=[{self.
|
|
52
|
+
logger.trace(f"New Value: original_value=[{self.__original_value}] ; type=[{self.__value_type.name}] ; value=[{self.__value}] ; value_to_eval=[{self.__value_to_eval}]")
|
|
53
53
|
|
|
54
54
|
def _verify_valid_compared_object(self, other, raise_exception=True):
|
|
55
55
|
res = isinstance(other, Value)
|
|
@@ -69,7 +69,11 @@ class Value(object):
|
|
|
69
69
|
return (self.get_value() < other.get_value())
|
|
70
70
|
else:
|
|
71
71
|
return TechnicalException(f"Unmanaged comparison between types '{self.__class__.__name__}' and '{other.__class__.__name__}'")
|
|
72
|
-
|
|
72
|
+
|
|
73
|
+
@property
|
|
74
|
+
def do_eval_once(self):
|
|
75
|
+
return self.__do_eval_once
|
|
76
|
+
|
|
73
77
|
@property
|
|
74
78
|
def string_value(self):
|
|
75
79
|
value = self.get_value()
|
|
@@ -41,6 +41,67 @@ Feature: Test python socket steps
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
@message_socket
|
|
44
|
+
@blocking_socket
|
|
45
|
+
Scenario: Echo server and message client with blocking connection
|
|
46
|
+
|
|
47
|
+
### PRECONDITIONS - BEGIN
|
|
48
|
+
Given begin preconditions
|
|
49
|
+
|
|
50
|
+
# Use echo server with a blocking connection
|
|
51
|
+
Given PORT = first available anonymous port
|
|
52
|
+
Given SERVER = new echo TCP socket server
|
|
53
|
+
| Name | Value |
|
|
54
|
+
| 'host' | '127.0.0.1' |
|
|
55
|
+
| 'port' | PORT |
|
|
56
|
+
|
|
57
|
+
# Create a message client
|
|
58
|
+
Given CLIENT = new message TCP socket client
|
|
59
|
+
| Name | Value |
|
|
60
|
+
| 'host' | '127.0.0.1' |
|
|
61
|
+
| 'port' | PORT |
|
|
62
|
+
| 'separator' | b'\n' |
|
|
63
|
+
|
|
64
|
+
Given end preconditions
|
|
65
|
+
### PRECONDITIONS - END
|
|
66
|
+
|
|
67
|
+
# Start echo server & message client
|
|
68
|
+
When start (socket server: SERVER)
|
|
69
|
+
When start (socket client: CLIENT)
|
|
70
|
+
|
|
71
|
+
# Write data and verify result is identical
|
|
72
|
+
When write message b'\x01\x02' (socket: CLIENT)
|
|
73
|
+
When write message b'\x11\x21' (socket: CLIENT)
|
|
74
|
+
|
|
75
|
+
# Verify received messages
|
|
76
|
+
When wait socket CLIENT stops to receive messages (window: 0.1 s)
|
|
77
|
+
When MESSAGES = received messages (socket: CLIENT)
|
|
78
|
+
Then MESSAGES is list
|
|
79
|
+
| b'\x01\x02' |
|
|
80
|
+
| b'\x11\x21' |
|
|
81
|
+
|
|
82
|
+
When MESSAGES_2 = received messages (socket: CLIENT)
|
|
83
|
+
Then MESSAGES_2 == MESSAGES
|
|
84
|
+
|
|
85
|
+
# Verify pop messages functionality
|
|
86
|
+
When MSG_1 = read message (socket: CLIENT)
|
|
87
|
+
Then MSG_1 == b'\x01\x02'
|
|
88
|
+
When MESSAGES_3 = received messages (socket: CLIENT)
|
|
89
|
+
Then MESSAGES_3 is list
|
|
90
|
+
| b'\x11\x21' |
|
|
91
|
+
|
|
92
|
+
When MSG_2 = read message (socket: CLIENT)
|
|
93
|
+
Then MSG_2 == b'\x11\x21'
|
|
94
|
+
When MESSAGES_4 = received messages (socket: CLIENT)
|
|
95
|
+
Then MESSAGES_4 is empty list
|
|
96
|
+
|
|
97
|
+
# Stop server & client
|
|
98
|
+
#When stop (socket server: SERVER)
|
|
99
|
+
When stop (socket client: CLIENT)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
@message_socket
|
|
104
|
+
@non_blocking_socket
|
|
44
105
|
Scenario: Echo server and message client with non blocking connection
|
|
45
106
|
|
|
46
107
|
### PRECONDITIONS - BEGIN
|
|
@@ -59,6 +120,7 @@ Feature: Test python socket steps
|
|
|
59
120
|
| 'host' | '127.0.0.1' |
|
|
60
121
|
| 'port' | PORT |
|
|
61
122
|
| 'separator' | b'\n' |
|
|
123
|
+
| 'blocking' | False |
|
|
62
124
|
|
|
63
125
|
Given end preconditions
|
|
64
126
|
### PRECONDITIONS - END
|
|
@@ -109,7 +109,81 @@ Feature: Test python socket steps with ssl
|
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
@message_socket
|
|
112
|
-
|
|
112
|
+
@blocking_socket
|
|
113
|
+
Scenario: Echo server and message client (with underlying blocking connection)
|
|
114
|
+
|
|
115
|
+
### PRECONDITIONS - BEGIN
|
|
116
|
+
Given begin preconditions
|
|
117
|
+
|
|
118
|
+
# Get files of a self-signed certificate
|
|
119
|
+
Given CERTFILE_PATH = certfile path for localhost
|
|
120
|
+
Given KEYFILE_PATH = keyfile path for localhost
|
|
121
|
+
|
|
122
|
+
# Use echo server with a blocking connection
|
|
123
|
+
Given PORT = first available anonymous port
|
|
124
|
+
Given SERVER = new echo TCP socket server
|
|
125
|
+
| Name | Value |
|
|
126
|
+
| 'host' | 'localhost' |
|
|
127
|
+
| 'port' | PORT |
|
|
128
|
+
| 'ssl.activate' | True |
|
|
129
|
+
| 'ssl.context.ciphers' | 'SHA256' |
|
|
130
|
+
| 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
|
|
131
|
+
| 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
|
|
132
|
+
|
|
133
|
+
# Create a message client
|
|
134
|
+
Given CLIENT = new message TCP socket client
|
|
135
|
+
| Name | Value |
|
|
136
|
+
| 'host' | 'localhost' |
|
|
137
|
+
| 'port' | PORT |
|
|
138
|
+
| 'separator' | b'\n' |
|
|
139
|
+
| 'ssl.activate' | True |
|
|
140
|
+
| 'ssl.context.check_hostname' | True |
|
|
141
|
+
| 'ssl.context.load_verify_locations.cafile' | CERTFILE_PATH |
|
|
142
|
+
|
|
143
|
+
Given end preconditions
|
|
144
|
+
### PRECONDITIONS - END
|
|
145
|
+
|
|
146
|
+
# Start echo server & message client
|
|
147
|
+
When start (socket server: SERVER)
|
|
148
|
+
#When ensure SSL handshake is done (socket: CLIENT)
|
|
149
|
+
When start (socket client: CLIENT)
|
|
150
|
+
|
|
151
|
+
# Write data and verify result is identical
|
|
152
|
+
When write message b'\x01\x02' (socket: CLIENT)
|
|
153
|
+
When write message b'\x11\x21' (socket: CLIENT)
|
|
154
|
+
|
|
155
|
+
# Verify received messages
|
|
156
|
+
When wait socket CLIENT stops to receive messages (window: 0.1 s)
|
|
157
|
+
When MESSAGES = received messages (socket: CLIENT)
|
|
158
|
+
Then MESSAGES is list
|
|
159
|
+
| b'\x01\x02' |
|
|
160
|
+
| b'\x11\x21' |
|
|
161
|
+
|
|
162
|
+
When MESSAGES_2 = received messages (socket: CLIENT)
|
|
163
|
+
Then MESSAGES_2 == MESSAGES
|
|
164
|
+
|
|
165
|
+
# Verify pop messages functionality
|
|
166
|
+
When MSG_1 = read message (socket: CLIENT)
|
|
167
|
+
Then MSG_1 == b'\x01\x02'
|
|
168
|
+
When MESSAGES_3 = received messages (socket: CLIENT)
|
|
169
|
+
Then MESSAGES_3 is list
|
|
170
|
+
| b'\x11\x21' |
|
|
171
|
+
|
|
172
|
+
When MSG_2 = read message (socket: CLIENT)
|
|
173
|
+
Then MSG_2 == b'\x11\x21'
|
|
174
|
+
When MESSAGES_4 = received messages (socket: CLIENT)
|
|
175
|
+
Then MESSAGES_4 is empty list
|
|
176
|
+
|
|
177
|
+
# Stop server & client
|
|
178
|
+
#When stop (socket server: SERVER)
|
|
179
|
+
# Note: currently, stop doesn't work with SSL and blocking connection
|
|
180
|
+
When stop (socket client: CLIENT)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
@message_socket
|
|
185
|
+
@non_blocking_socket
|
|
186
|
+
Scenario: Echo server and message client (with underlying non-blocking connection)
|
|
113
187
|
|
|
114
188
|
### PRECONDITIONS - BEGIN
|
|
115
189
|
Given begin preconditions
|
|
@@ -135,6 +209,7 @@ Feature: Test python socket steps with ssl
|
|
|
135
209
|
| 'host' | 'localhost' |
|
|
136
210
|
| 'port' | PORT |
|
|
137
211
|
| 'separator' | b'\n' |
|
|
212
|
+
| 'blocking' | False |
|
|
138
213
|
| 'ssl.activate' | True |
|
|
139
214
|
| 'ssl.context.check_hostname' | True |
|
|
140
215
|
| 'ssl.context.load_verify_locations.cafile' | CERTFILE_PATH |
|
|
@@ -144,6 +219,7 @@ Feature: Test python socket steps with ssl
|
|
|
144
219
|
|
|
145
220
|
# Start echo server & message client
|
|
146
221
|
When start (socket server: SERVER)
|
|
222
|
+
#When ensure SSL handshake is done (socket: CLIENT)
|
|
147
223
|
When start (socket client: CLIENT)
|
|
148
224
|
|
|
149
225
|
# Write data and verify result is identical
|
|
File without changes
|
|
File without changes
|