orionis 0.546.0__py3-none-any.whl → 0.547.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.547.0.dist-info}/METADATA +1 -1
- {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/RECORD +15 -159
- {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/top_level.txt +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.547.0.dist-info}/WHEEL +0 -0
- {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/zip-safe +0 -0
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
from orionis.container.validators.lifetime import LifetimeValidator
|
|
2
|
-
from orionis.container.enums.lifetimes import Lifetime
|
|
3
|
-
from orionis.container.exceptions.type import OrionisContainerTypeError
|
|
4
|
-
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
|
-
|
|
6
|
-
class TestLifetimeValidator(AsyncTestCase):
|
|
7
|
-
|
|
8
|
-
async def testValidLifetimeEnumValues(self) -> None:
|
|
9
|
-
"""
|
|
10
|
-
Validate that LifetimeValidator correctly accepts Lifetime enum values.
|
|
11
|
-
|
|
12
|
-
This test checks that the validator returns the corresponding Lifetime enum
|
|
13
|
-
when provided with valid enum values.
|
|
14
|
-
|
|
15
|
-
Returns
|
|
16
|
-
-------
|
|
17
|
-
None
|
|
18
|
-
This method does not return anything. It asserts correctness via test assertions.
|
|
19
|
-
"""
|
|
20
|
-
# Assert that each Lifetime enum value is accepted and returned as expected
|
|
21
|
-
self.assertEqual(LifetimeValidator(Lifetime.TRANSIENT), Lifetime.TRANSIENT)
|
|
22
|
-
self.assertEqual(LifetimeValidator(Lifetime.SINGLETON), Lifetime.SINGLETON)
|
|
23
|
-
self.assertEqual(LifetimeValidator(Lifetime.SCOPED), Lifetime.SCOPED)
|
|
24
|
-
|
|
25
|
-
async def testValidLifetimeStringValues(self) -> None:
|
|
26
|
-
"""
|
|
27
|
-
Validate that LifetimeValidator correctly accepts valid string representations.
|
|
28
|
-
|
|
29
|
-
This test verifies that the validator returns the correct Lifetime enum when
|
|
30
|
-
provided with valid string representations, including different cases and extra whitespace.
|
|
31
|
-
|
|
32
|
-
Returns
|
|
33
|
-
-------
|
|
34
|
-
None
|
|
35
|
-
This method does not return anything. It asserts correctness via test assertions.
|
|
36
|
-
"""
|
|
37
|
-
# Assert that valid uppercase string representations are accepted
|
|
38
|
-
self.assertEqual(LifetimeValidator("TRANSIENT"), Lifetime.TRANSIENT)
|
|
39
|
-
self.assertEqual(LifetimeValidator("SINGLETON"), Lifetime.SINGLETON)
|
|
40
|
-
self.assertEqual(LifetimeValidator("SCOPED"), Lifetime.SCOPED)
|
|
41
|
-
|
|
42
|
-
# Assert that lowercase and mixed case strings are accepted
|
|
43
|
-
self.assertEqual(LifetimeValidator("transient"), Lifetime.TRANSIENT)
|
|
44
|
-
self.assertEqual(LifetimeValidator("Singleton"), Lifetime.SINGLETON)
|
|
45
|
-
self.assertEqual(LifetimeValidator("scoped"), Lifetime.SCOPED)
|
|
46
|
-
|
|
47
|
-
# Assert that strings with extra whitespace are accepted
|
|
48
|
-
self.assertEqual(LifetimeValidator(" TRANSIENT "), Lifetime.TRANSIENT)
|
|
49
|
-
self.assertEqual(LifetimeValidator(" singleton "), Lifetime.SINGLETON)
|
|
50
|
-
|
|
51
|
-
async def testInvalidLifetimeStringValue(self) -> None:
|
|
52
|
-
"""
|
|
53
|
-
Validate that LifetimeValidator raises an error for invalid string values.
|
|
54
|
-
|
|
55
|
-
This test ensures that the validator raises OrionisContainerTypeError when
|
|
56
|
-
provided with an invalid string representation, and that the error message
|
|
57
|
-
contains information about valid options.
|
|
58
|
-
|
|
59
|
-
Returns
|
|
60
|
-
-------
|
|
61
|
-
None
|
|
62
|
-
This method does not return anything. It asserts correctness via test assertions.
|
|
63
|
-
"""
|
|
64
|
-
# Attempt to validate an invalid string and check for the expected exception
|
|
65
|
-
with self.assertRaises(OrionisContainerTypeError) as context:
|
|
66
|
-
LifetimeValidator("INVALID_LIFETIME")
|
|
67
|
-
|
|
68
|
-
# Assert that the error message contains relevant information
|
|
69
|
-
self.assertIn("Invalid lifetime 'INVALID_LIFETIME'", str(context.exception))
|
|
70
|
-
self.assertIn("Valid options are:", str(context.exception))
|
|
71
|
-
self.assertIn("TRANSIENT", str(context.exception))
|
|
72
|
-
self.assertIn("SINGLETON", str(context.exception))
|
|
73
|
-
self.assertIn("SCOPED", str(context.exception))
|
|
74
|
-
|
|
75
|
-
async def testInvalidLifetimeType(self) -> None:
|
|
76
|
-
"""
|
|
77
|
-
Validate that LifetimeValidator raises an error for invalid input types.
|
|
78
|
-
|
|
79
|
-
This test checks that the validator raises OrionisContainerTypeError when
|
|
80
|
-
provided with values of types other than str or Lifetime enum.
|
|
81
|
-
|
|
82
|
-
Returns
|
|
83
|
-
-------
|
|
84
|
-
None
|
|
85
|
-
This method does not return anything. It asserts correctness via test assertions.
|
|
86
|
-
"""
|
|
87
|
-
# List of invalid types to test
|
|
88
|
-
invalid_values = [
|
|
89
|
-
123,
|
|
90
|
-
3.14,
|
|
91
|
-
None,
|
|
92
|
-
True,
|
|
93
|
-
False,
|
|
94
|
-
[],
|
|
95
|
-
{},
|
|
96
|
-
(),
|
|
97
|
-
set()
|
|
98
|
-
]
|
|
99
|
-
|
|
100
|
-
# Assert that each invalid type raises the expected exception
|
|
101
|
-
for value in invalid_values:
|
|
102
|
-
with self.assertRaises(OrionisContainerTypeError) as context:
|
|
103
|
-
LifetimeValidator(value)
|
|
104
|
-
|
|
105
|
-
expected_msg = f"Lifetime must be of type str or Lifetime enum, got {type(value).__name__}."
|
|
106
|
-
self.assertEqual(str(context.exception), expected_msg)
|
tests/example/__init__.py
DELETED
|
File without changes
|