orionis 0.546.0__py3-none-any.whl → 0.548.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/console/base/scheduler_event_listener.py +0 -17
- orionis/console/contracts/schedule_event_listener.py +0 -18
- orionis/foundation/config/app/entities/app.py +3 -2
- orionis/foundation/config/app/enums/ciphers.py +5 -19
- orionis/foundation/config/session/entities/session.py +2 -2
- orionis/metadata/framework.py +1 -1
- orionis/services/encrypter/encrypter.py +115 -0
- orionis/services/environment/dynamic/caster.py +35 -27
- orionis/services/environment/key/key_generator.py +32 -11
- {orionis-0.546.0.dist-info → orionis-0.548.0.dist-info}/METADATA +1 -1
- {orionis-0.546.0.dist-info → orionis-0.548.0.dist-info}/RECORD +14 -159
- {orionis-0.546.0.dist-info → orionis-0.548.0.dist-info}/top_level.txt +0 -1
- orionis-0.546.0.dist-info/zip-safe +0 -1
- tests/container/__init__.py +0 -0
- tests/container/context/__init__.py +0 -0
- tests/container/context/test_manager.py +0 -38
- tests/container/context/test_scope.py +0 -32
- tests/container/core/__init__.py +0 -0
- tests/container/core/test_advanced_async.py +0 -234
- tests/container/core/test_async_optimizations.py +0 -268
- tests/container/core/test_container.py +0 -453
- tests/container/core/test_singleton.py +0 -122
- tests/container/core/test_thread_safety.py +0 -90
- tests/container/entities/__init__.py +0 -0
- tests/container/entities/test_binding.py +0 -242
- tests/container/enums/__init__.py +0 -0
- tests/container/enums/test_lifetimes.py +0 -97
- tests/container/facades/__init__.py +0 -0
- tests/container/facades/test_facade.py +0 -78
- tests/container/mocks/__init__.py +0 -0
- tests/container/mocks/mock_advanced_async.py +0 -332
- tests/container/mocks/mock_async_optimizations.py +0 -407
- tests/container/mocks/mock_auto_resolution.py +0 -192
- tests/container/mocks/mock_complex_classes.py +0 -792
- tests/container/mocks/mock_simple_classes.py +0 -98
- tests/container/providers/__init__.py +0 -0
- tests/container/providers/test_providers.py +0 -55
- tests/container/validators/__init__.py +0 -0
- tests/container/validators/test_implements.py +0 -186
- tests/container/validators/test_is_abstract_class.py +0 -147
- tests/container/validators/test_is_callable.py +0 -102
- tests/container/validators/test_is_concrete_class.py +0 -160
- tests/container/validators/test_is_instance.py +0 -150
- tests/container/validators/test_is_not_subclass.py +0 -49
- tests/container/validators/test_is_subclass.py +0 -178
- tests/container/validators/test_is_valid_alias.py +0 -147
- tests/container/validators/test_lifetime.py +0 -106
- tests/example/__init__.py +0 -0
- tests/example/test_example.py +0 -725
- tests/foundation/__init__.py +0 -0
- tests/foundation/config/__init__.py +0 -0
- tests/foundation/config/app/__init__.py +0 -0
- tests/foundation/config/app/test_foundation_config_app.py +0 -262
- tests/foundation/config/auth/__init__.py +0 -0
- tests/foundation/config/auth/test_foundation_config_auth.py +0 -29
- tests/foundation/config/cache/__init__.py +0 -0
- tests/foundation/config/cache/test_foundation_config_cache.py +0 -143
- tests/foundation/config/cache/test_foundation_config_cache_file.py +0 -126
- tests/foundation/config/cache/test_foundation_config_cache_stores.py +0 -156
- tests/foundation/config/cors/__init__.py +0 -0
- tests/foundation/config/cors/test_foundation_config_cors.py +0 -190
- tests/foundation/config/database/__init__.py +0 -0
- tests/foundation/config/database/test_foundation_config_database.py +0 -158
- tests/foundation/config/database/test_foundation_config_database_connections.py +0 -203
- tests/foundation/config/database/test_foundation_config_database_mysql.py +0 -354
- tests/foundation/config/database/test_foundation_config_database_oracle.py +0 -288
- tests/foundation/config/database/test_foundation_config_database_pgsql.py +0 -257
- tests/foundation/config/database/test_foundation_config_database_sqlite.py +0 -207
- tests/foundation/config/filesystems/__init__.py +0 -0
- tests/foundation/config/filesystems/test_foundation_config_filesystems.py +0 -160
- tests/foundation/config/filesystems/test_foundation_config_filesystems_aws.py +0 -189
- tests/foundation/config/filesystems/test_foundation_config_filesystems_disks.py +0 -184
- tests/foundation/config/filesystems/test_foundation_config_filesystems_local.py +0 -143
- tests/foundation/config/filesystems/test_foundation_config_filesystems_public.py +0 -184
- tests/foundation/config/logging/__init__.py +0 -0
- tests/foundation/config/logging/test_foundation_config_logging.py +0 -112
- tests/foundation/config/logging/test_foundation_config_logging_channels.py +0 -246
- tests/foundation/config/logging/test_foundation_config_logging_chunked.py +0 -217
- tests/foundation/config/logging/test_foundation_config_logging_daily.py +0 -220
- tests/foundation/config/logging/test_foundation_config_logging_hourly.py +0 -196
- tests/foundation/config/logging/test_foundation_config_logging_monthly.py +0 -214
- tests/foundation/config/logging/test_foundation_config_logging_stack.py +0 -178
- tests/foundation/config/logging/test_foundation_config_logging_weekly.py +0 -224
- tests/foundation/config/mail/__init__.py +0 -0
- tests/foundation/config/mail/test_foundation_config_mail.py +0 -145
- tests/foundation/config/mail/test_foundation_config_mail_file.py +0 -97
- tests/foundation/config/mail/test_foundation_config_mail_mailers.py +0 -106
- tests/foundation/config/mail/test_foundation_config_mail_smtp.py +0 -146
- tests/foundation/config/queue/__init__.py +0 -0
- tests/foundation/config/queue/test_foundation_config_queue.py +0 -88
- tests/foundation/config/queue/test_foundation_config_queue_brokers.py +0 -72
- tests/foundation/config/queue/test_foundation_config_queue_database.py +0 -134
- tests/foundation/config/root/__init__.py +0 -0
- tests/foundation/config/root/test_foundation_config_root_paths.py +0 -112
- tests/foundation/config/session/__init__.py +0 -0
- tests/foundation/config/session/test_foundation_config_session.py +0 -213
- tests/foundation/config/startup/__init__.py +0 -0
- tests/foundation/config/startup/test_foundation_config_startup.py +0 -202
- tests/foundation/config/testing/__init__.py +0 -0
- tests/foundation/config/testing/test_foundation_config_testing.py +0 -235
- tests/metadata/__init__.py +0 -0
- tests/metadata/test_metadata_framework.py +0 -140
- tests/metadata/test_metadata_package.py +0 -139
- tests/services/__init__.py +0 -0
- tests/services/asynchrony/__init__.py +0 -0
- tests/services/asynchrony/test_services_asynchrony_coroutine.py +0 -85
- tests/services/environment/__init__.py +0 -0
- tests/services/environment/test_services_environment.py +0 -226
- tests/services/introspection/__init__.py +0 -0
- tests/services/introspection/dependencies/__init__.py +0 -0
- tests/services/introspection/dependencies/mocks/__init__.py +0 -0
- tests/services/introspection/dependencies/mocks/mock_user.py +0 -30
- tests/services/introspection/dependencies/mocks/mock_user_controller.py +0 -27
- tests/services/introspection/dependencies/mocks/mock_users_permissions.py +0 -41
- tests/services/introspection/dependencies/test_reflect_dependencies.py +0 -261
- tests/services/introspection/reflection/__init__.py +0 -0
- tests/services/introspection/reflection/mock/__init__.py +0 -0
- tests/services/introspection/reflection/mock/fake_reflect_instance.py +0 -1115
- tests/services/introspection/reflection/test_reflection_abstract.py +0 -1011
- tests/services/introspection/reflection/test_reflection_callable.py +0 -206
- tests/services/introspection/reflection/test_reflection_concrete.py +0 -952
- tests/services/introspection/reflection/test_reflection_instance.py +0 -1233
- tests/services/introspection/reflection/test_reflection_module.py +0 -567
- tests/services/introspection/test_reflection.py +0 -462
- tests/services/log/__init__.py +0 -0
- tests/services/log/test_log.py +0 -97
- tests/services/system/__init__.py +0 -0
- tests/services/system/test_services_system_imports.py +0 -204
- tests/services/system/test_services_system_workers.py +0 -131
- tests/support/__init__.py +0 -0
- tests/support/entities/__init__.py +0 -0
- tests/support/entities/mock_dataclass.py +0 -40
- tests/support/entities/test_base.py +0 -64
- tests/support/patterns/__init__.py +0 -0
- tests/support/patterns/singleton/__init__.py +0 -0
- tests/support/patterns/singleton/test_patterns_singleton.py +0 -39
- tests/support/standard/__init__.py +0 -0
- tests/support/standard/test_services_std.py +0 -226
- tests/support/wrapper/__init__.py +0 -0
- tests/support/wrapper/test_services_wrapper_docdict.py +0 -202
- tests/testing/__init__.py +0 -0
- tests/testing/cases/__init__.py +0 -0
- tests/testing/cases/test_testing_asynchronous.py +0 -63
- tests/testing/cases/test_testing_synchronous.py +0 -57
- tests/testing/entities/__init__.py +0 -0
- tests/testing/entities/test_testing_result.py +0 -146
- tests/testing/enums/__init__.py +0 -0
- tests/testing/enums/test_testing_status.py +0 -63
- tests/testing/output/__init__.py +0 -0
- tests/testing/output/test_testing_dumper.py +0 -29
- tests/testing/output/test_testing_printer.py +0 -42
- tests/testing/records/__init__.py +0 -0
- tests/testing/records/test_testing_records.py +0 -171
- tests/testing/test_testing_unit.py +0 -164
- tests/testing/validators/__init__.py +0 -0
- tests/testing/validators/test_testing_validators.py +0 -392
- tests/testing/view/__init__.py +0 -0
- tests/testing/view/test_render.py +0 -30
- {orionis-0.546.0.dist-info → orionis-0.548.0.dist-info}/WHEEL +0 -0
- {orionis-0.546.0.dist-info → orionis-0.548.0.dist-info}/licenses/LICENCE +0 -0
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
from orionis.services.introspection.callables.reflection import ReflectionCallable
|
|
2
|
-
from orionis.services.introspection.dependencies.entities.resolve_argument import ResolveArguments
|
|
3
|
-
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
4
|
-
from orionis.services.introspection.exceptions import ReflectionTypeError
|
|
5
|
-
|
|
6
|
-
class TestReflectionCallable(AsyncTestCase):
|
|
7
|
-
|
|
8
|
-
async def testInitValidFunction(self):
|
|
9
|
-
"""
|
|
10
|
-
Test initialization of ReflectionCallable with a valid function.
|
|
11
|
-
|
|
12
|
-
Validates that a ReflectionCallable instance can be created with a standard function
|
|
13
|
-
and that the stored callable matches the original function.
|
|
14
|
-
|
|
15
|
-
Returns
|
|
16
|
-
-------
|
|
17
|
-
None
|
|
18
|
-
"""
|
|
19
|
-
def sample_function(a, b=2):
|
|
20
|
-
"""Sample docstring."""
|
|
21
|
-
return a + b
|
|
22
|
-
rc = ReflectionCallable(sample_function)
|
|
23
|
-
self.assertEqual(rc.getCallable(), sample_function)
|
|
24
|
-
|
|
25
|
-
async def testInitInvalid(self):
|
|
26
|
-
"""
|
|
27
|
-
Test initialization of ReflectionCallable with an invalid argument.
|
|
28
|
-
|
|
29
|
-
Ensures that passing a non-callable object (e.g., an integer) to ReflectionCallable
|
|
30
|
-
raises a ReflectionTypeError.
|
|
31
|
-
|
|
32
|
-
Returns
|
|
33
|
-
-------
|
|
34
|
-
None
|
|
35
|
-
"""
|
|
36
|
-
with self.assertRaises(ReflectionTypeError):
|
|
37
|
-
ReflectionCallable(123)
|
|
38
|
-
|
|
39
|
-
async def testGetName(self):
|
|
40
|
-
"""
|
|
41
|
-
Test retrieval of the function name from ReflectionCallable.
|
|
42
|
-
|
|
43
|
-
Checks that the getName() method returns the correct name of the wrapped function.
|
|
44
|
-
|
|
45
|
-
Returns
|
|
46
|
-
-------
|
|
47
|
-
None
|
|
48
|
-
"""
|
|
49
|
-
def sample_function(a, b=2):
|
|
50
|
-
"""Sample docstring."""
|
|
51
|
-
return a + b
|
|
52
|
-
rc = ReflectionCallable(sample_function)
|
|
53
|
-
self.assertEqual(rc.getName(), "sample_function")
|
|
54
|
-
|
|
55
|
-
async def testGetModuleName(self):
|
|
56
|
-
"""
|
|
57
|
-
Test retrieval of the module name from ReflectionCallable.
|
|
58
|
-
|
|
59
|
-
Verifies that getModuleName() returns the module name where the function is defined.
|
|
60
|
-
|
|
61
|
-
Returns
|
|
62
|
-
-------
|
|
63
|
-
None
|
|
64
|
-
"""
|
|
65
|
-
def sample_function(a, b=2):
|
|
66
|
-
"""Sample docstring."""
|
|
67
|
-
return a + b
|
|
68
|
-
rc = ReflectionCallable(sample_function)
|
|
69
|
-
self.assertEqual(rc.getModuleName(), sample_function.__module__)
|
|
70
|
-
|
|
71
|
-
async def testGetModuleWithCallableName(self):
|
|
72
|
-
"""
|
|
73
|
-
Test retrieval of the fully qualified name from ReflectionCallable.
|
|
74
|
-
|
|
75
|
-
Ensures that getModuleWithCallableName() returns the module and function name
|
|
76
|
-
in the format "<module>.<function_name>".
|
|
77
|
-
|
|
78
|
-
Returns
|
|
79
|
-
-------
|
|
80
|
-
None
|
|
81
|
-
"""
|
|
82
|
-
def sample_function(a, b=2):
|
|
83
|
-
"""Sample docstring."""
|
|
84
|
-
return a + b
|
|
85
|
-
rc = ReflectionCallable(sample_function)
|
|
86
|
-
expected = f"{sample_function.__module__}.sample_function"
|
|
87
|
-
self.assertEqual(rc.getModuleWithCallableName(), expected)
|
|
88
|
-
|
|
89
|
-
async def testGetDocstring(self):
|
|
90
|
-
"""
|
|
91
|
-
Test retrieval of the docstring from ReflectionCallable.
|
|
92
|
-
|
|
93
|
-
Confirms that getDocstring() returns the docstring of the wrapped function.
|
|
94
|
-
|
|
95
|
-
Returns
|
|
96
|
-
-------
|
|
97
|
-
None
|
|
98
|
-
"""
|
|
99
|
-
def sample_function(a, b=2):
|
|
100
|
-
"""Sample docstring."""
|
|
101
|
-
return a + b
|
|
102
|
-
rc = ReflectionCallable(sample_function)
|
|
103
|
-
self.assertIn("Sample docstring", rc.getDocstring())
|
|
104
|
-
|
|
105
|
-
async def testGetSourceCode(self):
|
|
106
|
-
"""
|
|
107
|
-
Test retrieval of source code from ReflectionCallable.
|
|
108
|
-
|
|
109
|
-
Checks that getSourceCode() returns the source code of the wrapped function,
|
|
110
|
-
and that the code contains the function definition.
|
|
111
|
-
|
|
112
|
-
Returns
|
|
113
|
-
-------
|
|
114
|
-
None
|
|
115
|
-
"""
|
|
116
|
-
def sample_function(a, b=2):
|
|
117
|
-
"""Sample docstring."""
|
|
118
|
-
return a + b
|
|
119
|
-
rc = ReflectionCallable(sample_function)
|
|
120
|
-
code = rc.getSourceCode()
|
|
121
|
-
self.assertIn("def sample_function", code)
|
|
122
|
-
|
|
123
|
-
async def testGetSourceCodeError(self):
|
|
124
|
-
"""
|
|
125
|
-
Test error handling when retrieving source code from a built-in function.
|
|
126
|
-
|
|
127
|
-
Ensures that getSourceCode() raises a ReflectionTypeError when called on a
|
|
128
|
-
built-in function (e.g., len) that lacks accessible source code.
|
|
129
|
-
|
|
130
|
-
Returns
|
|
131
|
-
-------
|
|
132
|
-
None
|
|
133
|
-
"""
|
|
134
|
-
with self.assertRaises(ReflectionTypeError):
|
|
135
|
-
rc = ReflectionCallable(len)
|
|
136
|
-
rc.getSourceCode()
|
|
137
|
-
|
|
138
|
-
async def testGetFile(self):
|
|
139
|
-
"""
|
|
140
|
-
Test retrieval of the file path from ReflectionCallable.
|
|
141
|
-
|
|
142
|
-
Verifies that getFile() returns the file path of the wrapped function and that
|
|
143
|
-
the path ends with '.py', indicating a Python source file.
|
|
144
|
-
|
|
145
|
-
Returns
|
|
146
|
-
-------
|
|
147
|
-
None
|
|
148
|
-
"""
|
|
149
|
-
def sample_function(a, b=2):
|
|
150
|
-
"""Sample docstring."""
|
|
151
|
-
return a + b
|
|
152
|
-
rc = ReflectionCallable(sample_function)
|
|
153
|
-
file_path = rc.getFile()
|
|
154
|
-
self.assertTrue(file_path.endswith(".py"))
|
|
155
|
-
|
|
156
|
-
async def testCallSync(self):
|
|
157
|
-
"""
|
|
158
|
-
Test synchronous invocation of the wrapped function using ReflectionCallable.
|
|
159
|
-
|
|
160
|
-
Validates that calling the wrapped function with arguments returns the expected result.
|
|
161
|
-
|
|
162
|
-
Returns
|
|
163
|
-
-------
|
|
164
|
-
None
|
|
165
|
-
"""
|
|
166
|
-
def sample_function(a, b=2):
|
|
167
|
-
"""Sample docstring."""
|
|
168
|
-
return a + b
|
|
169
|
-
rc = ReflectionCallable(sample_function)
|
|
170
|
-
self.assertEqual(rc.call(1, 2), 3)
|
|
171
|
-
|
|
172
|
-
async def testCallAsync(self):
|
|
173
|
-
"""
|
|
174
|
-
Test asynchronous invocation of an async function using ReflectionCallable.
|
|
175
|
-
|
|
176
|
-
Ensures that an asynchronous function can be called and awaited, returning the correct result.
|
|
177
|
-
|
|
178
|
-
Returns
|
|
179
|
-
-------
|
|
180
|
-
None
|
|
181
|
-
"""
|
|
182
|
-
async def sample_async_function(a, b=2):
|
|
183
|
-
"""Async docstring."""
|
|
184
|
-
return a + b
|
|
185
|
-
rc = ReflectionCallable(sample_async_function)
|
|
186
|
-
self.assertEqual(await rc.call(1, 2), 3)
|
|
187
|
-
|
|
188
|
-
async def testGetDependencies(self):
|
|
189
|
-
"""
|
|
190
|
-
Test retrieval of callable dependencies from ReflectionCallable.
|
|
191
|
-
|
|
192
|
-
Checks that getDependencies() returns a ResolveArguments object with
|
|
193
|
-
'resolved' and 'unresolved' attributes for the wrapped function.
|
|
194
|
-
|
|
195
|
-
Returns
|
|
196
|
-
-------
|
|
197
|
-
None
|
|
198
|
-
"""
|
|
199
|
-
def sample_function(a, b=2):
|
|
200
|
-
"""Sample docstring."""
|
|
201
|
-
return a + b
|
|
202
|
-
rc = ReflectionCallable(sample_function)
|
|
203
|
-
deps = rc.getDependencies()
|
|
204
|
-
self.assertIsInstance(deps, ResolveArguments)
|
|
205
|
-
self.assertTrue(hasattr(deps, "resolved"))
|
|
206
|
-
self.assertTrue(hasattr(deps, "unresolved"))
|