orionis 0.414.0__py3-none-any.whl → 0.416.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.
- orionis/metadata/framework.py +1 -1
- orionis/test/core/unit_test.py +26 -10
- orionis/test/output/dumper.py +1 -1
- {orionis-0.414.0.dist-info → orionis-0.416.0.dist-info}/METADATA +1 -1
- {orionis-0.414.0.dist-info → orionis-0.416.0.dist-info}/RECORD +81 -68
- orionis-0.416.0.dist-info/top_level.txt +4 -0
- tests/container/entities/test_binding.py +1 -1
- tests/container/test_thread_safety.py +0 -1
- tests/testing/cases/__init__.py +0 -0
- tests/testing/cases/test_testing_asynchronous.py +63 -0
- tests/testing/cases/test_testing_synchronous.py +59 -0
- tests/testing/entities/__init__.py +0 -0
- tests/testing/entities/test_testing_result.py +185 -0
- tests/testing/enums/__init__.py +0 -0
- tests/testing/enums/test_testing_status.py +68 -0
- tests/testing/output/__init__.py +0 -0
- tests/testing/output/test_testing_dumper.py +32 -0
- tests/testing/output/test_testing_printer.py +42 -0
- tests/testing/records/__init__.py +0 -0
- tests/testing/records/test_testing_records.py +181 -0
- tests/testing/test_testing_unit.py +110 -209
- tests/testing/validators/__init__.py +0 -0
- tests/testing/validators/test_testing_validators.py +449 -0
- orionis-0.414.0.dist-info/top_level.txt +0 -2
- tests/testing/test_testing_result.py +0 -131
- {tests/foundation → environment}/__init__.py +0 -0
- {tests/services/environment → environment}/test_services_environment.py +0 -0
- {tests/foundation/config → foundation}/__init__.py +0 -0
- {tests/foundation/config/app → foundation/config}/__init__.py +0 -0
- {tests/foundation/config/auth → foundation/config/app}/__init__.py +0 -0
- {tests/foundation → foundation}/config/app/test_foundation_config_app.py +0 -0
- {tests/foundation/config/cache → foundation/config/auth}/__init__.py +0 -0
- {tests/foundation → foundation}/config/auth/test_foundation_config_auth.py +0 -0
- {tests/foundation/config/cors → foundation/config/cache}/__init__.py +0 -0
- {tests/foundation → foundation}/config/cache/test_foundation_config_cache.py +0 -0
- {tests/foundation → foundation}/config/cache/test_foundation_config_cache_file.py +0 -0
- {tests/foundation → foundation}/config/cache/test_foundation_config_cache_stores.py +0 -0
- {tests/foundation/config/database → foundation/config/cors}/__init__.py +0 -0
- {tests/foundation → foundation}/config/cors/test_foundation_config_cors.py +0 -0
- {tests/foundation/config/filesystems → foundation/config/database}/__init__.py +0 -0
- {tests/foundation → foundation}/config/database/test_foundation_config_database.py +0 -0
- {tests/foundation → foundation}/config/database/test_foundation_config_database_connections.py +0 -0
- {tests/foundation → foundation}/config/database/test_foundation_config_database_mysql.py +0 -0
- {tests/foundation → foundation}/config/database/test_foundation_config_database_oracle.py +0 -0
- {tests/foundation → foundation}/config/database/test_foundation_config_database_pgsql.py +0 -0
- {tests/foundation → foundation}/config/database/test_foundation_config_database_sqlite.py +0 -0
- {tests/foundation/config/logging → foundation/config/filesystems}/__init__.py +0 -0
- {tests/foundation → foundation}/config/filesystems/test_foundation_config_filesystems.py +0 -0
- {tests/foundation → foundation}/config/filesystems/test_foundation_config_filesystems_aws.py +0 -0
- {tests/foundation → foundation}/config/filesystems/test_foundation_config_filesystems_disks.py +0 -0
- {tests/foundation → foundation}/config/filesystems/test_foundation_config_filesystems_local.py +0 -0
- {tests/foundation → foundation}/config/filesystems/test_foundation_config_filesystems_public.py +0 -0
- {tests/foundation/config/mail → foundation/config/logging}/__init__.py +0 -0
- {tests/foundation → foundation}/config/logging/test_foundation_config_logging.py +0 -0
- {tests/foundation → foundation}/config/logging/test_foundation_config_logging_channels.py +0 -0
- {tests/foundation → foundation}/config/logging/test_foundation_config_logging_chunked.py +0 -0
- {tests/foundation → foundation}/config/logging/test_foundation_config_logging_daily.py +0 -0
- {tests/foundation → foundation}/config/logging/test_foundation_config_logging_hourly.py +0 -0
- {tests/foundation → foundation}/config/logging/test_foundation_config_logging_monthly.py +0 -0
- {tests/foundation → foundation}/config/logging/test_foundation_config_logging_stack.py +0 -0
- {tests/foundation → foundation}/config/logging/test_foundation_config_logging_weekly.py +0 -0
- {tests/foundation/config/queue → foundation/config/mail}/__init__.py +0 -0
- {tests/foundation → foundation}/config/mail/test_foundation_config_mail.py +0 -0
- {tests/foundation → foundation}/config/mail/test_foundation_config_mail_file.py +0 -0
- {tests/foundation → foundation}/config/mail/test_foundation_config_mail_mailers.py +0 -0
- {tests/foundation → foundation}/config/mail/test_foundation_config_mail_smtp.py +0 -0
- {tests/foundation/config/root → foundation/config/queue}/__init__.py +0 -0
- {tests/foundation → foundation}/config/queue/test_foundation_config_queue.py +0 -0
- {tests/foundation → foundation}/config/queue/test_foundation_config_queue_brokers.py +0 -0
- {tests/foundation → foundation}/config/queue/test_foundation_config_queue_database.py +0 -0
- {tests/foundation/config/session → foundation/config/root}/__init__.py +0 -0
- {tests/foundation → foundation}/config/root/test_foundation_config_root_paths.py +0 -0
- {tests/foundation/config/startup → foundation/config/session}/__init__.py +0 -0
- {tests/foundation → foundation}/config/session/test_foundation_config_session.py +0 -0
- {tests/foundation/config/testing → foundation/config/startup}/__init__.py +0 -0
- {tests/foundation → foundation}/config/startup/test_foundation_config_startup.py +0 -0
- {tests/foundation/exceptions → foundation/config/testing}/__init__.py +0 -0
- {tests/foundation → foundation}/config/testing/test_foundation_config_testing.py +0 -0
- {tests/services/environment → foundation/exceptions}/__init__.py +0 -0
- {tests/foundation → foundation}/exceptions/test_foundation_config_exceptions.py +0 -0
- {orionis-0.414.0.dist-info → orionis-0.416.0.dist-info}/WHEEL +0 -0
- {orionis-0.414.0.dist-info → orionis-0.416.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.414.0.dist-info → orionis-0.416.0.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
2
|
+
from orionis.support.facades.workers import Workers
|
|
3
|
+
from orionis.test.exceptions import OrionisTestValueError
|
|
4
|
+
from orionis.test.validators import *
|
|
5
|
+
|
|
6
|
+
class TestTestingDumper(AsyncTestCase):
|
|
7
|
+
|
|
8
|
+
async def testValidWorkers(self) -> None:
|
|
9
|
+
"""
|
|
10
|
+
Tests the ValidWorkers validator for correct validation of worker counts.
|
|
11
|
+
|
|
12
|
+
This method verifies that ValidWorkers accepts valid worker counts within the allowed range,
|
|
13
|
+
and raises OrionisTestValueError for invalid values such as zero, negative numbers, values
|
|
14
|
+
exceeding the maximum allowed, and non-integer types.
|
|
15
|
+
|
|
16
|
+
Returns
|
|
17
|
+
-------
|
|
18
|
+
None
|
|
19
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
20
|
+
"""
|
|
21
|
+
# Get the maximum allowed number of workers from the Workers facade
|
|
22
|
+
max_allowed = Workers.calculate()
|
|
23
|
+
|
|
24
|
+
# Valid cases: should return the input value if within allowed range
|
|
25
|
+
self.assertEqual(ValidWorkers(1), 1)
|
|
26
|
+
self.assertEqual(ValidWorkers(max_allowed), max_allowed)
|
|
27
|
+
|
|
28
|
+
# Invalid cases: should raise OrionisTestValueError for out-of-range or wrong type
|
|
29
|
+
with self.assertRaises(OrionisTestValueError):
|
|
30
|
+
ValidWorkers(0) # Zero is not allowed
|
|
31
|
+
with self.assertRaises(OrionisTestValueError):
|
|
32
|
+
ValidWorkers(max_allowed + 1) # Exceeds maximum allowed
|
|
33
|
+
with self.assertRaises(OrionisTestValueError):
|
|
34
|
+
ValidWorkers(-5) # Negative value is not allowed
|
|
35
|
+
with self.assertRaises(OrionisTestValueError):
|
|
36
|
+
ValidWorkers("not_an_int") # Non-integer type is not allowed
|
|
37
|
+
|
|
38
|
+
async def testValidBasePath(self) -> None:
|
|
39
|
+
"""
|
|
40
|
+
Tests the ValidBasePath validator for correct validation of base path inputs.
|
|
41
|
+
|
|
42
|
+
This method checks that ValidBasePath accepts valid path strings and Path objects,
|
|
43
|
+
returning a pathlib.Path instance. It also verifies that invalid inputs such as empty strings,
|
|
44
|
+
None, and non-path types raise OrionisTestValueError.
|
|
45
|
+
|
|
46
|
+
Parameters
|
|
47
|
+
----------
|
|
48
|
+
None
|
|
49
|
+
|
|
50
|
+
Returns
|
|
51
|
+
-------
|
|
52
|
+
None
|
|
53
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
54
|
+
"""
|
|
55
|
+
from orionis.test.validators import ValidBasePath
|
|
56
|
+
from pathlib import Path
|
|
57
|
+
|
|
58
|
+
# Valid cases: should return a Path instance for valid string or Path input
|
|
59
|
+
self.assertIsInstance(ValidBasePath("/tmp"), Path)
|
|
60
|
+
self.assertIsInstance(ValidBasePath(Path("/tmp")), Path)
|
|
61
|
+
|
|
62
|
+
# Invalid cases: should raise OrionisTestValueError for empty string, None, or non-path type
|
|
63
|
+
with self.assertRaises(OrionisTestValueError):
|
|
64
|
+
ValidBasePath("")
|
|
65
|
+
with self.assertRaises(OrionisTestValueError):
|
|
66
|
+
ValidBasePath(None)
|
|
67
|
+
with self.assertRaises(OrionisTestValueError):
|
|
68
|
+
ValidBasePath(123)
|
|
69
|
+
|
|
70
|
+
async def testValidExecutionMode(self) -> None:
|
|
71
|
+
"""
|
|
72
|
+
Tests the ValidExecutionMode validator for correct validation of execution mode inputs.
|
|
73
|
+
|
|
74
|
+
This method verifies that ValidExecutionMode accepts valid execution mode strings and enum values,
|
|
75
|
+
returning the corresponding string value. It also checks that invalid inputs such as unknown strings
|
|
76
|
+
and non-enum types raise OrionisTestValueError.
|
|
77
|
+
|
|
78
|
+
Parameters
|
|
79
|
+
----------
|
|
80
|
+
None
|
|
81
|
+
|
|
82
|
+
Returns
|
|
83
|
+
-------
|
|
84
|
+
None
|
|
85
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
86
|
+
"""
|
|
87
|
+
from orionis.test.validators import ValidExecutionMode
|
|
88
|
+
from orionis.foundation.config.testing.enums.mode import ExecutionMode
|
|
89
|
+
|
|
90
|
+
# Valid cases: should return the string value for valid mode string or enum input
|
|
91
|
+
self.assertEqual(ValidExecutionMode("parallel"), ExecutionMode.PARALLEL.value)
|
|
92
|
+
self.assertEqual(ValidExecutionMode(ExecutionMode.SEQUENTIAL), ExecutionMode.SEQUENTIAL.value)
|
|
93
|
+
|
|
94
|
+
# Invalid cases: should raise OrionisTestValueError for unknown string or non-enum type
|
|
95
|
+
with self.assertRaises(OrionisTestValueError):
|
|
96
|
+
ValidExecutionMode("INVALID") # Unknown execution mode string
|
|
97
|
+
with self.assertRaises(OrionisTestValueError):
|
|
98
|
+
ValidExecutionMode(123) # Non-enum type
|
|
99
|
+
|
|
100
|
+
async def testValidFailFast(self) -> None:
|
|
101
|
+
"""
|
|
102
|
+
Tests the ValidFailFast validator for correct validation of fail-fast configuration.
|
|
103
|
+
|
|
104
|
+
This method verifies that ValidFailFast accepts valid boolean inputs, returning the corresponding
|
|
105
|
+
boolean value. It also checks that invalid inputs, such as non-boolean types or None, raise
|
|
106
|
+
OrionisTestValueError.
|
|
107
|
+
|
|
108
|
+
Parameters
|
|
109
|
+
----------
|
|
110
|
+
None
|
|
111
|
+
|
|
112
|
+
Returns
|
|
113
|
+
-------
|
|
114
|
+
None
|
|
115
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
116
|
+
"""
|
|
117
|
+
from orionis.test.validators import ValidFailFast
|
|
118
|
+
|
|
119
|
+
# Valid cases: should return True or False for boolean input
|
|
120
|
+
self.assertTrue(ValidFailFast(True))
|
|
121
|
+
self.assertFalse(ValidFailFast(False))
|
|
122
|
+
|
|
123
|
+
# Invalid cases: should raise OrionisTestValueError for non-boolean or None input
|
|
124
|
+
with self.assertRaises(OrionisTestValueError):
|
|
125
|
+
ValidFailFast("not_bool")
|
|
126
|
+
with self.assertRaises(OrionisTestValueError):
|
|
127
|
+
ValidFailFast(None)
|
|
128
|
+
|
|
129
|
+
async def testValidFolderPath(self) -> None:
|
|
130
|
+
"""
|
|
131
|
+
Tests the ValidFolderPath validator for correct validation of folder path inputs.
|
|
132
|
+
|
|
133
|
+
This method checks that ValidFolderPath accepts valid folder path strings, including those
|
|
134
|
+
with leading or trailing whitespace, and returns the normalized string path. It also verifies
|
|
135
|
+
that invalid inputs such as empty strings, None, or non-string types raise OrionisTestValueError.
|
|
136
|
+
|
|
137
|
+
Returns
|
|
138
|
+
-------
|
|
139
|
+
None
|
|
140
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
141
|
+
"""
|
|
142
|
+
from orionis.test.validators import ValidFolderPath
|
|
143
|
+
|
|
144
|
+
# Valid cases: should return the normalized string path for valid input
|
|
145
|
+
self.assertEqual(ValidFolderPath("/tmp"), "/tmp")
|
|
146
|
+
self.assertEqual(ValidFolderPath(" /tmp "), "/tmp")
|
|
147
|
+
|
|
148
|
+
# Invalid cases: should raise OrionisTestValueError for empty string, None, or non-string type
|
|
149
|
+
with self.assertRaises(OrionisTestValueError):
|
|
150
|
+
ValidFolderPath("")
|
|
151
|
+
with self.assertRaises(OrionisTestValueError):
|
|
152
|
+
ValidFolderPath(None)
|
|
153
|
+
with self.assertRaises(OrionisTestValueError):
|
|
154
|
+
ValidFolderPath(123)
|
|
155
|
+
|
|
156
|
+
async def testValidModuleName(self) -> None:
|
|
157
|
+
"""
|
|
158
|
+
Tests the ValidModuleName validator for correct validation of module name inputs.
|
|
159
|
+
|
|
160
|
+
This method verifies that ValidModuleName accepts valid non-empty string module names,
|
|
161
|
+
returning the normalized string value. It also checks that invalid inputs such as empty strings,
|
|
162
|
+
None, or non-string types raise OrionisTestValueError.
|
|
163
|
+
|
|
164
|
+
Parameters
|
|
165
|
+
----------
|
|
166
|
+
None
|
|
167
|
+
|
|
168
|
+
Returns
|
|
169
|
+
-------
|
|
170
|
+
None
|
|
171
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
172
|
+
"""
|
|
173
|
+
from orionis.test.validators import ValidModuleName
|
|
174
|
+
|
|
175
|
+
# Valid case: should return the normalized string for a valid module name
|
|
176
|
+
self.assertEqual(ValidModuleName("mod"), "mod")
|
|
177
|
+
|
|
178
|
+
# Invalid cases: should raise OrionisTestValueError for empty string, None, or non-string type
|
|
179
|
+
with self.assertRaises(OrionisTestValueError):
|
|
180
|
+
ValidModuleName("")
|
|
181
|
+
with self.assertRaises(OrionisTestValueError):
|
|
182
|
+
ValidModuleName(None)
|
|
183
|
+
with self.assertRaises(OrionisTestValueError):
|
|
184
|
+
ValidModuleName(123)
|
|
185
|
+
|
|
186
|
+
async def testValidNamePattern(self) -> None:
|
|
187
|
+
"""
|
|
188
|
+
Tests the ValidNamePattern validator for correct validation of name pattern inputs.
|
|
189
|
+
|
|
190
|
+
This method verifies that ValidNamePattern accepts valid non-empty string patterns and None,
|
|
191
|
+
returning the normalized string pattern or None. It also checks that invalid inputs such as
|
|
192
|
+
empty strings or non-string types raise OrionisTestValueError.
|
|
193
|
+
|
|
194
|
+
Parameters
|
|
195
|
+
----------
|
|
196
|
+
None
|
|
197
|
+
|
|
198
|
+
Returns
|
|
199
|
+
-------
|
|
200
|
+
None
|
|
201
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
202
|
+
"""
|
|
203
|
+
from orionis.test.validators import ValidNamePattern
|
|
204
|
+
|
|
205
|
+
# Valid case: should return the normalized string for a valid pattern
|
|
206
|
+
self.assertEqual(ValidNamePattern("test_*"), "test_*")
|
|
207
|
+
|
|
208
|
+
# Valid case: should return None when input is None
|
|
209
|
+
self.assertIsNone(ValidNamePattern(None))
|
|
210
|
+
|
|
211
|
+
# Invalid cases: should raise OrionisTestValueError for empty string or non-string type
|
|
212
|
+
with self.assertRaises(OrionisTestValueError):
|
|
213
|
+
ValidNamePattern("")
|
|
214
|
+
with self.assertRaises(OrionisTestValueError):
|
|
215
|
+
ValidNamePattern(123)
|
|
216
|
+
|
|
217
|
+
async def testValidPattern(self) -> None:
|
|
218
|
+
"""
|
|
219
|
+
Tests the ValidPattern validator for correct validation of pattern string inputs.
|
|
220
|
+
|
|
221
|
+
This method verifies that ValidPattern accepts valid non-empty string patterns,
|
|
222
|
+
returning the normalized string value. It also checks that invalid inputs such as
|
|
223
|
+
empty strings, None, or non-string types raise OrionisTestValueError.
|
|
224
|
+
|
|
225
|
+
Returns
|
|
226
|
+
-------
|
|
227
|
+
None
|
|
228
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
229
|
+
"""
|
|
230
|
+
from orionis.test.validators import ValidPattern
|
|
231
|
+
|
|
232
|
+
# Valid case: should return the normalized string for a valid pattern
|
|
233
|
+
self.assertEqual(ValidPattern("abc"), "abc")
|
|
234
|
+
|
|
235
|
+
# Invalid cases: should raise OrionisTestValueError for empty string, None, or non-string type
|
|
236
|
+
with self.assertRaises(OrionisTestValueError):
|
|
237
|
+
ValidPattern("")
|
|
238
|
+
with self.assertRaises(OrionisTestValueError):
|
|
239
|
+
ValidPattern(None)
|
|
240
|
+
with self.assertRaises(OrionisTestValueError):
|
|
241
|
+
ValidPattern(123)
|
|
242
|
+
|
|
243
|
+
async def testValidPersistentDriver(self) -> None:
|
|
244
|
+
"""
|
|
245
|
+
Tests the ValidPersistentDriver validator for correct validation of persistent driver inputs.
|
|
246
|
+
|
|
247
|
+
This method verifies that ValidPersistentDriver accepts valid persistent driver names as strings
|
|
248
|
+
and enum values, returning the corresponding normalized string value. It also checks that invalid
|
|
249
|
+
inputs, such as unknown driver names or non-enum types, raise OrionisTestValueError.
|
|
250
|
+
|
|
251
|
+
Parameters
|
|
252
|
+
----------
|
|
253
|
+
None
|
|
254
|
+
|
|
255
|
+
Returns
|
|
256
|
+
-------
|
|
257
|
+
None
|
|
258
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
259
|
+
"""
|
|
260
|
+
from orionis.test.validators import ValidPersistentDriver
|
|
261
|
+
from orionis.foundation.config.testing.enums.drivers import PersistentDrivers
|
|
262
|
+
|
|
263
|
+
# Valid cases: should return the normalized string for valid driver name or enum input
|
|
264
|
+
self.assertEqual(ValidPersistentDriver("sqlite"), "sqlite")
|
|
265
|
+
self.assertEqual(ValidPersistentDriver(PersistentDrivers.SQLITE), "sqlite")
|
|
266
|
+
|
|
267
|
+
# Invalid cases: should raise OrionisTestValueError for unknown driver name or non-enum type
|
|
268
|
+
with self.assertRaises(OrionisTestValueError):
|
|
269
|
+
ValidPersistentDriver("invalid")
|
|
270
|
+
with self.assertRaises(OrionisTestValueError):
|
|
271
|
+
ValidPersistentDriver(123)
|
|
272
|
+
|
|
273
|
+
async def testValidPersistent(self) -> None:
|
|
274
|
+
"""
|
|
275
|
+
Tests the ValidPersistent validator for correct validation of persistent configuration values.
|
|
276
|
+
|
|
277
|
+
This method verifies that ValidPersistent accepts valid boolean inputs, returning the corresponding
|
|
278
|
+
boolean value. It also checks that invalid inputs, such as non-boolean types or None, raise
|
|
279
|
+
OrionisTestValueError.
|
|
280
|
+
|
|
281
|
+
Parameters
|
|
282
|
+
----------
|
|
283
|
+
None
|
|
284
|
+
|
|
285
|
+
Returns
|
|
286
|
+
-------
|
|
287
|
+
None
|
|
288
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
289
|
+
"""
|
|
290
|
+
from orionis.test.validators import ValidPersistent
|
|
291
|
+
|
|
292
|
+
# Valid cases: should return True or False for boolean input
|
|
293
|
+
self.assertTrue(ValidPersistent(True))
|
|
294
|
+
self.assertFalse(ValidPersistent(False))
|
|
295
|
+
|
|
296
|
+
# Invalid cases: should raise OrionisTestValueError for non-boolean or None input
|
|
297
|
+
with self.assertRaises(OrionisTestValueError):
|
|
298
|
+
ValidPersistent("not_bool")
|
|
299
|
+
with self.assertRaises(OrionisTestValueError):
|
|
300
|
+
ValidPersistent(None)
|
|
301
|
+
|
|
302
|
+
async def testValidPrintResult(self) -> None:
|
|
303
|
+
"""
|
|
304
|
+
Tests the ValidPrintResult validator for correct validation of print result configuration.
|
|
305
|
+
|
|
306
|
+
This method verifies that ValidPrintResult accepts valid boolean inputs, returning the corresponding
|
|
307
|
+
boolean value. It also checks that invalid inputs, such as non-boolean types or None, raise
|
|
308
|
+
OrionisTestValueError.
|
|
309
|
+
|
|
310
|
+
Parameters
|
|
311
|
+
----------
|
|
312
|
+
None
|
|
313
|
+
|
|
314
|
+
Returns
|
|
315
|
+
-------
|
|
316
|
+
None
|
|
317
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
318
|
+
"""
|
|
319
|
+
from orionis.test.validators import ValidPrintResult
|
|
320
|
+
|
|
321
|
+
# Valid cases: should return True or False for boolean input
|
|
322
|
+
self.assertTrue(ValidPrintResult(True))
|
|
323
|
+
self.assertFalse(ValidPrintResult(False))
|
|
324
|
+
|
|
325
|
+
# Invalid cases: should raise OrionisTestValueError for non-boolean or None input
|
|
326
|
+
with self.assertRaises(OrionisTestValueError):
|
|
327
|
+
ValidPrintResult("not_bool")
|
|
328
|
+
with self.assertRaises(OrionisTestValueError):
|
|
329
|
+
ValidPrintResult(None)
|
|
330
|
+
|
|
331
|
+
async def testValidTags(self) -> None:
|
|
332
|
+
"""
|
|
333
|
+
Tests the ValidTags validator for correct validation of tag list inputs.
|
|
334
|
+
|
|
335
|
+
This method verifies that ValidTags accepts a list of non-empty string tags, normalizes whitespace,
|
|
336
|
+
and returns a list of cleaned tag strings. It also checks that None is accepted and returns None.
|
|
337
|
+
Invalid cases, such as empty lists, lists containing empty strings or non-string types, and non-list
|
|
338
|
+
inputs, should raise OrionisTestValueError.
|
|
339
|
+
|
|
340
|
+
Returns
|
|
341
|
+
-------
|
|
342
|
+
None
|
|
343
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
344
|
+
"""
|
|
345
|
+
from orionis.test.validators import ValidTags
|
|
346
|
+
|
|
347
|
+
# Valid case: should return a list of normalized tag strings
|
|
348
|
+
self.assertEqual(ValidTags(["a", "b ", " c"]), ["a", "b", "c"])
|
|
349
|
+
|
|
350
|
+
# Valid case: should return None when input is None
|
|
351
|
+
self.assertIsNone(ValidTags(None))
|
|
352
|
+
|
|
353
|
+
# Invalid case: should raise OrionisTestValueError for empty list
|
|
354
|
+
with self.assertRaises(OrionisTestValueError):
|
|
355
|
+
ValidTags([])
|
|
356
|
+
|
|
357
|
+
# Invalid case: should raise OrionisTestValueError for list containing empty string
|
|
358
|
+
with self.assertRaises(OrionisTestValueError):
|
|
359
|
+
ValidTags([""])
|
|
360
|
+
|
|
361
|
+
# Invalid case: should raise OrionisTestValueError for list containing non-string type
|
|
362
|
+
with self.assertRaises(OrionisTestValueError):
|
|
363
|
+
ValidTags([123])
|
|
364
|
+
|
|
365
|
+
# Invalid case: should raise OrionisTestValueError for non-list input
|
|
366
|
+
with self.assertRaises(OrionisTestValueError):
|
|
367
|
+
ValidTags("not_a_list")
|
|
368
|
+
|
|
369
|
+
async def testValidThrowException(self) -> None:
|
|
370
|
+
"""
|
|
371
|
+
Tests the ValidThrowException validator for correct validation of throw exception configuration.
|
|
372
|
+
|
|
373
|
+
This method verifies that ValidThrowException accepts valid boolean inputs, returning the corresponding
|
|
374
|
+
boolean value. It also checks that invalid inputs, such as non-boolean types or None, raise
|
|
375
|
+
OrionisTestValueError.
|
|
376
|
+
|
|
377
|
+
Parameters
|
|
378
|
+
----------
|
|
379
|
+
None
|
|
380
|
+
|
|
381
|
+
Returns
|
|
382
|
+
-------
|
|
383
|
+
None
|
|
384
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
385
|
+
"""
|
|
386
|
+
from orionis.test.validators import ValidThrowException
|
|
387
|
+
|
|
388
|
+
# Valid cases: should return True or False for boolean input
|
|
389
|
+
self.assertTrue(ValidThrowException(True))
|
|
390
|
+
self.assertFalse(ValidThrowException(False))
|
|
391
|
+
|
|
392
|
+
# Invalid cases: should raise OrionisTestValueError for non-boolean or None input
|
|
393
|
+
with self.assertRaises(OrionisTestValueError):
|
|
394
|
+
ValidThrowException("not_bool")
|
|
395
|
+
with self.assertRaises(OrionisTestValueError):
|
|
396
|
+
ValidThrowException(None)
|
|
397
|
+
|
|
398
|
+
async def testValidVerbosity(self) -> None:
|
|
399
|
+
"""
|
|
400
|
+
Tests the ValidVerbosity validator for correct validation of verbosity mode inputs.
|
|
401
|
+
|
|
402
|
+
This method verifies that ValidVerbosity accepts valid verbosity mode enum values and their corresponding
|
|
403
|
+
integer values, returning the normalized integer value. It also checks that invalid inputs such as
|
|
404
|
+
negative values, unknown integers, or non-integer types raise OrionisTestValueError.
|
|
405
|
+
|
|
406
|
+
Returns
|
|
407
|
+
-------
|
|
408
|
+
None
|
|
409
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
410
|
+
"""
|
|
411
|
+
from orionis.test.validators import ValidVerbosity
|
|
412
|
+
from orionis.foundation.config.testing.enums.verbosity import VerbosityMode
|
|
413
|
+
|
|
414
|
+
# Valid cases: should return the integer value for valid enum or integer input
|
|
415
|
+
self.assertEqual(ValidVerbosity(VerbosityMode.MINIMAL), VerbosityMode.MINIMAL.value)
|
|
416
|
+
self.assertEqual(ValidVerbosity(VerbosityMode.DETAILED.value), VerbosityMode.DETAILED.value)
|
|
417
|
+
|
|
418
|
+
# Invalid cases: should raise OrionisTestValueError for negative, unknown, or non-integer input
|
|
419
|
+
with self.assertRaises(OrionisTestValueError):
|
|
420
|
+
ValidVerbosity(-1)
|
|
421
|
+
with self.assertRaises(OrionisTestValueError):
|
|
422
|
+
ValidVerbosity("not_int")
|
|
423
|
+
with self.assertRaises(OrionisTestValueError):
|
|
424
|
+
ValidVerbosity(999)
|
|
425
|
+
|
|
426
|
+
async def testValidWebReport(self) -> None:
|
|
427
|
+
"""
|
|
428
|
+
Tests the ValidWebReport validator for correct validation of web report configuration.
|
|
429
|
+
|
|
430
|
+
This method verifies that ValidWebReport accepts valid boolean inputs, returning the corresponding
|
|
431
|
+
boolean value. It also checks that invalid inputs, such as non-boolean types or None, raise
|
|
432
|
+
OrionisTestValueError.
|
|
433
|
+
|
|
434
|
+
Returns
|
|
435
|
+
-------
|
|
436
|
+
None
|
|
437
|
+
This method does not return any value. It asserts expected behavior using test assertions.
|
|
438
|
+
"""
|
|
439
|
+
from orionis.test.validators import ValidWebReport
|
|
440
|
+
|
|
441
|
+
# Valid cases: should return True or False for boolean input
|
|
442
|
+
self.assertTrue(ValidWebReport(True))
|
|
443
|
+
self.assertFalse(ValidWebReport(False))
|
|
444
|
+
|
|
445
|
+
# Invalid cases: should raise OrionisTestValueError for non-boolean or None input
|
|
446
|
+
with self.assertRaises(OrionisTestValueError):
|
|
447
|
+
ValidWebReport("not_bool")
|
|
448
|
+
with self.assertRaises(OrionisTestValueError):
|
|
449
|
+
ValidWebReport(None)
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
# from orionis.test.cases.asynchronous import AsyncTestCase
|
|
2
|
-
# from orionis.test.entities.result import TestResult
|
|
3
|
-
# from orionis.test.enums import TestStatus
|
|
4
|
-
|
|
5
|
-
# class TestTestingResult(AsyncTestCase):
|
|
6
|
-
|
|
7
|
-
# async def testDefaultValues(self) -> None:
|
|
8
|
-
# """
|
|
9
|
-
# Ensures that when optional fields are not provided during initialization of a TestResult
|
|
10
|
-
# instance, they are set to None.
|
|
11
|
-
|
|
12
|
-
# Notes
|
|
13
|
-
# -----
|
|
14
|
-
# This test verifies the default behavior of the following optional fields:
|
|
15
|
-
# - error_message
|
|
16
|
-
# - traceback
|
|
17
|
-
# - class_name
|
|
18
|
-
# - method
|
|
19
|
-
# - module
|
|
20
|
-
# - file_path
|
|
21
|
-
|
|
22
|
-
# Assertions
|
|
23
|
-
# ----------
|
|
24
|
-
# Each optional field is checked to confirm it is None after initialization.
|
|
25
|
-
# """
|
|
26
|
-
# result = TestResult(
|
|
27
|
-
# id=1,
|
|
28
|
-
# name="Sample Test",
|
|
29
|
-
# status=TestStatus.PASSED,
|
|
30
|
-
# execution_time=0.5
|
|
31
|
-
# )
|
|
32
|
-
# self.assertIsNone(result.error_message)
|
|
33
|
-
# self.assertIsNone(result.traceback)
|
|
34
|
-
# self.assertIsNone(result.class_name)
|
|
35
|
-
# self.assertIsNone(result.method)
|
|
36
|
-
# self.assertIsNone(result.module)
|
|
37
|
-
# self.assertIsNone(result.file_path)
|
|
38
|
-
|
|
39
|
-
# async def testRequiredFields(self) -> None:
|
|
40
|
-
# """
|
|
41
|
-
# Test that TestResult enforces the presence of all required (non-optional) fields during initialization.
|
|
42
|
-
# This test verifies that omitting any required field when creating a TestResult instance raises a TypeError.
|
|
43
|
-
|
|
44
|
-
# Notes
|
|
45
|
-
# -----
|
|
46
|
-
# - Attempts to instantiate TestResult with no arguments.
|
|
47
|
-
# - Attempts to instantiate TestResult missing the 'id' field.
|
|
48
|
-
# - Expects a TypeError to be raised in both cases.
|
|
49
|
-
# """
|
|
50
|
-
# with self.assertRaises(TypeError):
|
|
51
|
-
# TestResult() # Missing all required fields
|
|
52
|
-
|
|
53
|
-
# with self.assertRaises(TypeError):
|
|
54
|
-
# # Missing id
|
|
55
|
-
# TestResult(
|
|
56
|
-
# name="Sample Test",
|
|
57
|
-
# status=TestStatus.PASSED,
|
|
58
|
-
# execution_time=0.5
|
|
59
|
-
# )
|
|
60
|
-
|
|
61
|
-
# async def testImmutable(self) -> None:
|
|
62
|
-
# """
|
|
63
|
-
# Test the immutability of TestResult instances.
|
|
64
|
-
# This test ensures that TestResult, implemented as a frozen dataclass, does not allow
|
|
65
|
-
# modification of its attributes after instantiation.
|
|
66
|
-
|
|
67
|
-
# Parameters
|
|
68
|
-
# ----------
|
|
69
|
-
# self : TestCase
|
|
70
|
-
# The test case instance.
|
|
71
|
-
|
|
72
|
-
# Raises
|
|
73
|
-
# ------
|
|
74
|
-
# FrozenInstanceError
|
|
75
|
-
# If an attempt is made to modify an attribute of a frozen TestResult instance.
|
|
76
|
-
# """
|
|
77
|
-
# result = TestResult(
|
|
78
|
-
# id=1,
|
|
79
|
-
# name="Sample Test",
|
|
80
|
-
# status=TestStatus.PASSED,
|
|
81
|
-
# execution_time=0.5
|
|
82
|
-
# )
|
|
83
|
-
# with self.assertRaises(Exception):
|
|
84
|
-
# result.name = "Modified Name"
|
|
85
|
-
|
|
86
|
-
# async def testStatusValues(self) -> None:
|
|
87
|
-
# """
|
|
88
|
-
# Parameters
|
|
89
|
-
# ----------
|
|
90
|
-
# self : TestCase
|
|
91
|
-
# The test case instance.
|
|
92
|
-
|
|
93
|
-
# Notes
|
|
94
|
-
# -----
|
|
95
|
-
# This test iterates over all possible values of the `TestStatus` enum and verifies
|
|
96
|
-
# that each value can be assigned to the `status` field of a `TestResult` instance.
|
|
97
|
-
# It asserts that the assigned status matches the expected value.
|
|
98
|
-
# """
|
|
99
|
-
# for status in TestStatus:
|
|
100
|
-
# result = TestResult(
|
|
101
|
-
# id=1,
|
|
102
|
-
# name="Status Test",
|
|
103
|
-
# status=status,
|
|
104
|
-
# execution_time=0.1
|
|
105
|
-
# )
|
|
106
|
-
# self.assertEqual(result.status, status)
|
|
107
|
-
|
|
108
|
-
# async def testErrorFields(self) -> None:
|
|
109
|
-
# """
|
|
110
|
-
# Parameters
|
|
111
|
-
# ----------
|
|
112
|
-
# self : TestCase
|
|
113
|
-
# The test case instance.
|
|
114
|
-
|
|
115
|
-
# Notes
|
|
116
|
-
# -----
|
|
117
|
-
# Verifies that the `error_message` and `traceback` fields are correctly stored in the `TestResult`
|
|
118
|
-
# object when provided during initialization.
|
|
119
|
-
# """
|
|
120
|
-
# error_msg = "Test failed"
|
|
121
|
-
# traceback = "Traceback info"
|
|
122
|
-
# result = TestResult(
|
|
123
|
-
# id=1,
|
|
124
|
-
# name="Failing Test",
|
|
125
|
-
# status=TestStatus.FAILED,
|
|
126
|
-
# execution_time=0.2,
|
|
127
|
-
# error_message=error_msg,
|
|
128
|
-
# traceback=traceback
|
|
129
|
-
# )
|
|
130
|
-
# self.assertEqual(result.error_message, error_msg)
|
|
131
|
-
# self.assertEqual(result.traceback, traceback)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tests/foundation → foundation}/config/database/test_foundation_config_database_connections.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tests/foundation → foundation}/config/filesystems/test_foundation_config_filesystems_aws.py
RENAMED
|
File without changes
|
{tests/foundation → foundation}/config/filesystems/test_foundation_config_filesystems_disks.py
RENAMED
|
File without changes
|
{tests/foundation → foundation}/config/filesystems/test_foundation_config_filesystems_local.py
RENAMED
|
File without changes
|
{tests/foundation → foundation}/config/filesystems/test_foundation_config_filesystems_public.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|