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.
Files changed (160) hide show
  1. orionis/console/base/scheduler_event_listener.py +0 -17
  2. orionis/console/contracts/schedule_event_listener.py +0 -18
  3. orionis/foundation/config/app/entities/app.py +3 -2
  4. orionis/foundation/config/app/enums/ciphers.py +5 -19
  5. orionis/foundation/config/session/entities/session.py +2 -2
  6. orionis/metadata/framework.py +1 -1
  7. orionis/services/encrypter/encrypter.py +115 -0
  8. orionis/services/environment/dynamic/caster.py +35 -27
  9. orionis/services/environment/key/key_generator.py +32 -11
  10. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/METADATA +1 -1
  11. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/RECORD +15 -159
  12. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/top_level.txt +0 -1
  13. tests/container/__init__.py +0 -0
  14. tests/container/context/__init__.py +0 -0
  15. tests/container/context/test_manager.py +0 -38
  16. tests/container/context/test_scope.py +0 -32
  17. tests/container/core/__init__.py +0 -0
  18. tests/container/core/test_advanced_async.py +0 -234
  19. tests/container/core/test_async_optimizations.py +0 -268
  20. tests/container/core/test_container.py +0 -453
  21. tests/container/core/test_singleton.py +0 -122
  22. tests/container/core/test_thread_safety.py +0 -90
  23. tests/container/entities/__init__.py +0 -0
  24. tests/container/entities/test_binding.py +0 -242
  25. tests/container/enums/__init__.py +0 -0
  26. tests/container/enums/test_lifetimes.py +0 -97
  27. tests/container/facades/__init__.py +0 -0
  28. tests/container/facades/test_facade.py +0 -78
  29. tests/container/mocks/__init__.py +0 -0
  30. tests/container/mocks/mock_advanced_async.py +0 -332
  31. tests/container/mocks/mock_async_optimizations.py +0 -407
  32. tests/container/mocks/mock_auto_resolution.py +0 -192
  33. tests/container/mocks/mock_complex_classes.py +0 -792
  34. tests/container/mocks/mock_simple_classes.py +0 -98
  35. tests/container/providers/__init__.py +0 -0
  36. tests/container/providers/test_providers.py +0 -55
  37. tests/container/validators/__init__.py +0 -0
  38. tests/container/validators/test_implements.py +0 -186
  39. tests/container/validators/test_is_abstract_class.py +0 -147
  40. tests/container/validators/test_is_callable.py +0 -102
  41. tests/container/validators/test_is_concrete_class.py +0 -160
  42. tests/container/validators/test_is_instance.py +0 -150
  43. tests/container/validators/test_is_not_subclass.py +0 -49
  44. tests/container/validators/test_is_subclass.py +0 -178
  45. tests/container/validators/test_is_valid_alias.py +0 -147
  46. tests/container/validators/test_lifetime.py +0 -106
  47. tests/example/__init__.py +0 -0
  48. tests/example/test_example.py +0 -725
  49. tests/foundation/__init__.py +0 -0
  50. tests/foundation/config/__init__.py +0 -0
  51. tests/foundation/config/app/__init__.py +0 -0
  52. tests/foundation/config/app/test_foundation_config_app.py +0 -262
  53. tests/foundation/config/auth/__init__.py +0 -0
  54. tests/foundation/config/auth/test_foundation_config_auth.py +0 -29
  55. tests/foundation/config/cache/__init__.py +0 -0
  56. tests/foundation/config/cache/test_foundation_config_cache.py +0 -143
  57. tests/foundation/config/cache/test_foundation_config_cache_file.py +0 -126
  58. tests/foundation/config/cache/test_foundation_config_cache_stores.py +0 -156
  59. tests/foundation/config/cors/__init__.py +0 -0
  60. tests/foundation/config/cors/test_foundation_config_cors.py +0 -190
  61. tests/foundation/config/database/__init__.py +0 -0
  62. tests/foundation/config/database/test_foundation_config_database.py +0 -158
  63. tests/foundation/config/database/test_foundation_config_database_connections.py +0 -203
  64. tests/foundation/config/database/test_foundation_config_database_mysql.py +0 -354
  65. tests/foundation/config/database/test_foundation_config_database_oracle.py +0 -288
  66. tests/foundation/config/database/test_foundation_config_database_pgsql.py +0 -257
  67. tests/foundation/config/database/test_foundation_config_database_sqlite.py +0 -207
  68. tests/foundation/config/filesystems/__init__.py +0 -0
  69. tests/foundation/config/filesystems/test_foundation_config_filesystems.py +0 -160
  70. tests/foundation/config/filesystems/test_foundation_config_filesystems_aws.py +0 -189
  71. tests/foundation/config/filesystems/test_foundation_config_filesystems_disks.py +0 -184
  72. tests/foundation/config/filesystems/test_foundation_config_filesystems_local.py +0 -143
  73. tests/foundation/config/filesystems/test_foundation_config_filesystems_public.py +0 -184
  74. tests/foundation/config/logging/__init__.py +0 -0
  75. tests/foundation/config/logging/test_foundation_config_logging.py +0 -112
  76. tests/foundation/config/logging/test_foundation_config_logging_channels.py +0 -246
  77. tests/foundation/config/logging/test_foundation_config_logging_chunked.py +0 -217
  78. tests/foundation/config/logging/test_foundation_config_logging_daily.py +0 -220
  79. tests/foundation/config/logging/test_foundation_config_logging_hourly.py +0 -196
  80. tests/foundation/config/logging/test_foundation_config_logging_monthly.py +0 -214
  81. tests/foundation/config/logging/test_foundation_config_logging_stack.py +0 -178
  82. tests/foundation/config/logging/test_foundation_config_logging_weekly.py +0 -224
  83. tests/foundation/config/mail/__init__.py +0 -0
  84. tests/foundation/config/mail/test_foundation_config_mail.py +0 -145
  85. tests/foundation/config/mail/test_foundation_config_mail_file.py +0 -97
  86. tests/foundation/config/mail/test_foundation_config_mail_mailers.py +0 -106
  87. tests/foundation/config/mail/test_foundation_config_mail_smtp.py +0 -146
  88. tests/foundation/config/queue/__init__.py +0 -0
  89. tests/foundation/config/queue/test_foundation_config_queue.py +0 -88
  90. tests/foundation/config/queue/test_foundation_config_queue_brokers.py +0 -72
  91. tests/foundation/config/queue/test_foundation_config_queue_database.py +0 -134
  92. tests/foundation/config/root/__init__.py +0 -0
  93. tests/foundation/config/root/test_foundation_config_root_paths.py +0 -112
  94. tests/foundation/config/session/__init__.py +0 -0
  95. tests/foundation/config/session/test_foundation_config_session.py +0 -213
  96. tests/foundation/config/startup/__init__.py +0 -0
  97. tests/foundation/config/startup/test_foundation_config_startup.py +0 -202
  98. tests/foundation/config/testing/__init__.py +0 -0
  99. tests/foundation/config/testing/test_foundation_config_testing.py +0 -235
  100. tests/metadata/__init__.py +0 -0
  101. tests/metadata/test_metadata_framework.py +0 -140
  102. tests/metadata/test_metadata_package.py +0 -139
  103. tests/services/__init__.py +0 -0
  104. tests/services/asynchrony/__init__.py +0 -0
  105. tests/services/asynchrony/test_services_asynchrony_coroutine.py +0 -85
  106. tests/services/environment/__init__.py +0 -0
  107. tests/services/environment/test_services_environment.py +0 -226
  108. tests/services/introspection/__init__.py +0 -0
  109. tests/services/introspection/dependencies/__init__.py +0 -0
  110. tests/services/introspection/dependencies/mocks/__init__.py +0 -0
  111. tests/services/introspection/dependencies/mocks/mock_user.py +0 -30
  112. tests/services/introspection/dependencies/mocks/mock_user_controller.py +0 -27
  113. tests/services/introspection/dependencies/mocks/mock_users_permissions.py +0 -41
  114. tests/services/introspection/dependencies/test_reflect_dependencies.py +0 -261
  115. tests/services/introspection/reflection/__init__.py +0 -0
  116. tests/services/introspection/reflection/mock/__init__.py +0 -0
  117. tests/services/introspection/reflection/mock/fake_reflect_instance.py +0 -1115
  118. tests/services/introspection/reflection/test_reflection_abstract.py +0 -1011
  119. tests/services/introspection/reflection/test_reflection_callable.py +0 -206
  120. tests/services/introspection/reflection/test_reflection_concrete.py +0 -952
  121. tests/services/introspection/reflection/test_reflection_instance.py +0 -1233
  122. tests/services/introspection/reflection/test_reflection_module.py +0 -567
  123. tests/services/introspection/test_reflection.py +0 -462
  124. tests/services/log/__init__.py +0 -0
  125. tests/services/log/test_log.py +0 -97
  126. tests/services/system/__init__.py +0 -0
  127. tests/services/system/test_services_system_imports.py +0 -204
  128. tests/services/system/test_services_system_workers.py +0 -131
  129. tests/support/__init__.py +0 -0
  130. tests/support/entities/__init__.py +0 -0
  131. tests/support/entities/mock_dataclass.py +0 -40
  132. tests/support/entities/test_base.py +0 -64
  133. tests/support/patterns/__init__.py +0 -0
  134. tests/support/patterns/singleton/__init__.py +0 -0
  135. tests/support/patterns/singleton/test_patterns_singleton.py +0 -39
  136. tests/support/standard/__init__.py +0 -0
  137. tests/support/standard/test_services_std.py +0 -226
  138. tests/support/wrapper/__init__.py +0 -0
  139. tests/support/wrapper/test_services_wrapper_docdict.py +0 -202
  140. tests/testing/__init__.py +0 -0
  141. tests/testing/cases/__init__.py +0 -0
  142. tests/testing/cases/test_testing_asynchronous.py +0 -63
  143. tests/testing/cases/test_testing_synchronous.py +0 -57
  144. tests/testing/entities/__init__.py +0 -0
  145. tests/testing/entities/test_testing_result.py +0 -146
  146. tests/testing/enums/__init__.py +0 -0
  147. tests/testing/enums/test_testing_status.py +0 -63
  148. tests/testing/output/__init__.py +0 -0
  149. tests/testing/output/test_testing_dumper.py +0 -29
  150. tests/testing/output/test_testing_printer.py +0 -42
  151. tests/testing/records/__init__.py +0 -0
  152. tests/testing/records/test_testing_records.py +0 -171
  153. tests/testing/test_testing_unit.py +0 -164
  154. tests/testing/validators/__init__.py +0 -0
  155. tests/testing/validators/test_testing_validators.py +0 -392
  156. tests/testing/view/__init__.py +0 -0
  157. tests/testing/view/test_render.py +0 -30
  158. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/WHEEL +0 -0
  159. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/licenses/LICENCE +0 -0
  160. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/zip-safe +0 -0
@@ -1,242 +0,0 @@
1
- from orionis.container.entities.binding import Binding
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 TestEntities(AsyncTestCase):
7
-
8
- async def testBindingInitialization(self):
9
- """
10
- Test initialization of a Binding object with default values.
11
-
12
- This test verifies that when a Binding instance is created without any arguments,
13
- all attributes are set to their expected default values.
14
-
15
- Parameters
16
- ----------
17
- self : TestBinding
18
- The test case instance.
19
-
20
- Returns
21
- -------
22
- None
23
- This method does not return anything. Assertions are used to validate behavior.
24
-
25
- Raises
26
- ------
27
- AssertionError
28
- If any of the default values are incorrect or the Binding initialization fails.
29
- """
30
-
31
- # Create a Binding instance with default parameters
32
- binding: Binding = Binding()
33
-
34
- # Assert that all attributes are set to their default values
35
- self.assertIsNone(binding.contract) # Default contract should be None
36
- self.assertIsNone(binding.concrete) # Default concrete should be None
37
- self.assertIsNone(binding.instance) # Default instance should be None
38
- self.assertIsNone(binding.function) # Default function should be None
39
- self.assertEqual(binding.lifetime, Lifetime.TRANSIENT) # Default lifetime should be TRANSIENT
40
- self.assertFalse(binding.enforce_decoupling) # Default enforce_decoupling should be False
41
- self.assertIsNone(binding.alias) # Default alias should be None
42
-
43
- async def testBindingCustomValues(self):
44
- """
45
- Test initialization of a Binding object with custom values.
46
-
47
- This test verifies that when a Binding instance is created with explicit arguments,
48
- all attributes are set to the provided custom values, and the object reflects the intended configuration.
49
-
50
- Parameters
51
- ----------
52
- self : TestBinding
53
- The test case instance.
54
-
55
- Returns
56
- -------
57
- None
58
- This method does not return anything. Assertions are used to validate correct attribute assignment.
59
-
60
- Raises
61
- ------
62
- AssertionError
63
- If the Binding initialization fails or custom values are not set correctly.
64
- """
65
-
66
- # Define dummy contract and concrete classes for testing
67
- class TestContract: pass
68
- class TestConcrete: pass
69
-
70
- # Create an instance for the 'instance' attribute
71
- instance = TestConcrete()
72
-
73
- # Define a factory function for the 'function' attribute
74
- factory_func = lambda: TestConcrete()
75
-
76
- # Initialize Binding with custom values
77
- binding = Binding(
78
- contract=TestContract,
79
- concrete=TestConcrete,
80
- instance=instance,
81
- function=factory_func,
82
- lifetime=Lifetime.SINGLETON,
83
- enforce_decoupling=True,
84
- alias="test_binding"
85
- )
86
-
87
- # Assert that all attributes are set to the provided custom values
88
- self.assertIs(binding.contract, TestContract)
89
- self.assertIs(binding.concrete, TestConcrete)
90
- self.assertIs(binding.instance, instance)
91
- self.assertIs(binding.function, factory_func)
92
- self.assertEqual(binding.lifetime, Lifetime.SINGLETON)
93
- self.assertTrue(binding.enforce_decoupling)
94
- self.assertEqual(binding.alias, "test_binding")
95
-
96
- async def testBindingPostInitValidation(self):
97
- """
98
- Validates that the `__post_init__` method of the `Binding` class raises appropriate
99
- exceptions when invalid types are provided for certain attributes.
100
-
101
- This test ensures that type validation is enforced for the `lifetime`, `enforce_decoupling`,
102
- and `alias` attributes during initialization. If an invalid type is passed, the
103
- `OrionisContainerTypeError` should be raised.
104
-
105
- Parameters
106
- ----------
107
- self : TestBinding
108
- The test case instance.
109
-
110
- Returns
111
- -------
112
- None
113
- This method does not return anything. Assertions are used to validate that
114
- exceptions are raised for invalid input types.
115
-
116
- Raises
117
- ------
118
- AssertionError
119
- If the expected `OrionisContainerTypeError` is not raised when invalid types
120
- are provided for the attributes.
121
- """
122
-
123
- # Attempt to initialize Binding with an invalid lifetime type (should raise exception)
124
- with self.assertRaises(OrionisContainerTypeError):
125
- Binding(lifetime="not_a_lifetime")
126
-
127
- # Attempt to initialize Binding with an invalid enforce_decoupling type (should raise exception)
128
- with self.assertRaises(OrionisContainerTypeError):
129
- Binding(enforce_decoupling="not_a_bool")
130
-
131
- # Attempt to initialize Binding with an invalid alias type (should raise exception)
132
- with self.assertRaises(OrionisContainerTypeError):
133
- Binding(alias=123)
134
-
135
- async def testToDictMethod(self):
136
- """
137
- Tests the `toDict` method of the `Binding` class to ensure it returns a correct dictionary representation
138
- of the binding's attributes.
139
-
140
- This test verifies that the dictionary contains all expected keys and that their values match the attributes
141
- set during initialization. It also checks that the types and values are correctly preserved.
142
-
143
- Parameters
144
- ----------
145
- self : TestBinding
146
- The test case instance.
147
-
148
- Returns
149
- -------
150
- None
151
- This method does not return anything. Assertions are used to validate the correctness of the dictionary representation.
152
-
153
- Raises
154
- ------
155
- AssertionError
156
- If the dictionary representation is incorrect or any attribute does not match the expected value.
157
- """
158
-
159
- # Define dummy contract and concrete classes for testing
160
- class TestContract: pass
161
- class TestConcrete: pass
162
-
163
- # Create a Binding instance with custom values
164
- binding = Binding(
165
- contract=TestContract,
166
- concrete=TestConcrete,
167
- lifetime=Lifetime.SINGLETON,
168
- enforce_decoupling=True,
169
- alias="test_binding"
170
- )
171
-
172
- # Get the dictionary representation of the binding
173
- result = binding.toDict()
174
-
175
- # Assert that the result is a dictionary
176
- self.assertIsInstance(result, dict)
177
-
178
- # Assert that contract and concrete are correctly set
179
- self.assertIs(result["contract"], TestContract)
180
- self.assertIs(result["concrete"], TestConcrete)
181
-
182
- # Assert that instance and function are None by default
183
- self.assertIsNone(result["instance"])
184
- self.assertIsNone(result["function"])
185
-
186
- # Assert that lifetime, enforce_decoupling, and alias are correctly set
187
- self.assertEqual(result["lifetime"], Lifetime.SINGLETON)
188
- self.assertTrue(result["enforce_decoupling"])
189
- self.assertEqual(result["alias"], "test_binding")
190
-
191
- async def testGetFieldsMethod(self):
192
- """
193
- Tests the `getFields` method of the `Binding` class to ensure it returns accurate field metadata.
194
-
195
- This test verifies that the returned list contains the expected number of fields, that all expected
196
- field names are present, and that specific field metadata (such as default values and descriptions)
197
- are correctly provided for the `lifetime` field.
198
-
199
- Parameters
200
- ----------
201
- self : TestBinding
202
- The test case instance.
203
-
204
- Returns
205
- -------
206
- None
207
- This method does not return anything. Assertions are used to validate the correctness of the
208
- field metadata returned by `getFields`.
209
-
210
- Raises
211
- ------
212
- AssertionError
213
- If the field information is incorrect, such as missing fields, incorrect defaults, or missing metadata.
214
- """
215
-
216
- # Create a Binding instance with default parameters
217
- binding = Binding()
218
-
219
- # Retrieve field metadata using getFields
220
- fields_info = binding.getFields()
221
-
222
- # Assert that the returned value is a list
223
- self.assertIsInstance(fields_info, list)
224
-
225
- # Assert that there are exactly 7 fields
226
- self.assertEqual(len(fields_info), 7)
227
-
228
- # Extract field names from the metadata
229
- field_names = [field["name"] for field in fields_info]
230
- expected_names = ["contract", "concrete", "instance", "function", "lifetime", "enforce_decoupling", "alias"]
231
-
232
- # Assert that all expected field names are present
233
- self.assertTrue(all(name in field_names for name in expected_names))
234
-
235
- # Find the metadata for the 'lifetime' field
236
- lifetime_field = next(field for field in fields_info if field["name"] == "lifetime")
237
-
238
- # Assert that the default value for 'lifetime' is correct
239
- self.assertEqual(lifetime_field["default"], Lifetime.TRANSIENT.value)
240
-
241
- # Assert that the 'lifetime' field contains a description in its metadata
242
- self.assertIn("description", lifetime_field["metadata"])
File without changes
@@ -1,97 +0,0 @@
1
- from orionis.container.enums.lifetimes import Lifetime
2
- from orionis.test.cases.asynchronous import AsyncTestCase
3
-
4
- class TestLifetime(AsyncTestCase):
5
-
6
- async def testLifetimeValuesExist(self) -> None:
7
- """
8
- Checks that the `Lifetime` enum contains the expected lifecycle values.
9
-
10
- This test verifies the presence of the following enum members:
11
- - `TRANSIENT`
12
- - `SINGLETON`
13
- - `SCOPED`
14
-
15
- Returns
16
- -------
17
- None
18
- This method does not return any value. It asserts the existence of enum members.
19
- """
20
-
21
- # Assert that each expected enum member exists in Lifetime
22
- self.assertIn(Lifetime.TRANSIENT, Lifetime)
23
- self.assertIn(Lifetime.SINGLETON, Lifetime)
24
- self.assertIn(Lifetime.SCOPED, Lifetime)
25
-
26
- async def testLifetimeValuesAreUnique(self) -> None:
27
- """
28
- Ensures that all `Lifetime` enum values are unique.
29
-
30
- This test collects the integer values of all enum members and checks that
31
- there are no duplicates.
32
-
33
- Returns
34
- -------
35
- None
36
- This method does not return any value. It asserts uniqueness of enum values.
37
- """
38
-
39
- # Gather all enum values
40
- values = [member.value for member in Lifetime]
41
-
42
- # Assert that all values are unique
43
- self.assertEqual(len(values), len(set(values)))
44
-
45
- async def testLifetimeCount(self) -> None:
46
- """
47
- Validates that the `Lifetime` enum defines exactly three lifecycle types.
48
-
49
- This test ensures that no additional or missing enum members exist.
50
-
51
- Returns
52
- -------
53
- None
54
- This method does not return any value. It asserts the count of enum members.
55
- """
56
-
57
- # Assert that there are exactly three members in the Lifetime enum
58
- self.assertEqual(len(list(Lifetime)), 3)
59
-
60
- async def testLifetimeStringRepresentation(self) -> None:
61
- """
62
- Verifies the string representation of `Lifetime` enum members.
63
-
64
- This test checks that converting each enum member to a string yields the expected format.
65
-
66
- Returns
67
- -------
68
- None
69
- This method does not return any value. It asserts string representations.
70
- """
71
-
72
- # Assert that string representations match expected format
73
- self.assertEqual(str(Lifetime.TRANSIENT), "Lifetime.TRANSIENT")
74
- self.assertEqual(str(Lifetime.SINGLETON), "Lifetime.SINGLETON")
75
- self.assertEqual(str(Lifetime.SCOPED), "Lifetime.SCOPED")
76
-
77
- async def testLifetimeComparison(self) -> None:
78
- """
79
- Tests comparison operations between `Lifetime` enum members.
80
-
81
- This test verifies that each enum member is only equal to itself and not to others.
82
-
83
- Returns
84
- -------
85
- None
86
- This method does not return any value. It asserts comparison results.
87
- """
88
-
89
- # Assert that different enum members are not equal
90
- self.assertNotEqual(Lifetime.TRANSIENT, Lifetime.SINGLETON)
91
- self.assertNotEqual(Lifetime.SINGLETON, Lifetime.SCOPED)
92
- self.assertNotEqual(Lifetime.TRANSIENT, Lifetime.SCOPED)
93
-
94
- # Assert that each enum member is equal to itself
95
- self.assertEqual(Lifetime.TRANSIENT, Lifetime.TRANSIENT)
96
- self.assertEqual(Lifetime.SINGLETON, Lifetime.SINGLETON)
97
- self.assertEqual(Lifetime.SCOPED, Lifetime.SCOPED)
File without changes
@@ -1,78 +0,0 @@
1
- import inspect
2
- from orionis.container.facades.facade import FacadeMeta, Facade
3
- from orionis.test.cases.asynchronous import AsyncTestCase
4
-
5
- class TestFacadeMethods(AsyncTestCase):
6
-
7
- async def testFacadeMethodsExist(self):
8
- """
9
- Verify the existence of essential methods in the Facade and FacadeMeta classes.
10
-
11
- This test checks for the implementation of the following methods:
12
- - 'getFacadeAccessor' in the Facade class
13
- - 'resolve' in the Facade class
14
- - '__getattr__' in the FacadeMeta class
15
-
16
- The method asserts the presence of these required methods and raises an AssertionError if any are missing.
17
-
18
- Parameters
19
- ----------
20
- None
21
-
22
- Returns
23
- -------
24
- None
25
- Returns None. The method performs assertions to validate method existence.
26
- """
27
-
28
- # List of expected methods and their corresponding classes
29
- expected_methods = [
30
- ("getFacadeAccessor", Facade),
31
- ("resolve", Facade),
32
- ("__getattr__", FacadeMeta),
33
- ]
34
-
35
- # Iterate through each expected method and assert its existence
36
- for method_name, cls in expected_methods:
37
- self.assertTrue(
38
- hasattr(cls, method_name),
39
- f"Method '{method_name}' does not exist in {cls.__name__}."
40
- )
41
-
42
- async def testFacadeMethodSignatures(self):
43
- """
44
- Validate the method signatures of key Facade and FacadeMeta class methods.
45
-
46
- This test checks that:
47
- - 'getFacadeAccessor' in Facade accepts no parameters.
48
- - 'resolve' in Facade accepts variable positional and keyword arguments.
49
- - '__getattr__' in FacadeMeta accepts 'cls' and 'name' as parameters.
50
-
51
- The method asserts correct method signatures and raises AssertionError if any signature does not match expectations.
52
-
53
- Parameters
54
- ----------
55
- None
56
-
57
- Returns
58
- -------
59
- None
60
- Returns None. The method performs assertions to validate method signatures.
61
- """
62
-
63
- # Check that getFacadeAccessor has no parameters
64
- sig = inspect.signature(Facade.getFacadeAccessor)
65
- params = list(sig.parameters.values())
66
- self.assertEqual(len(params), 0)
67
-
68
- # Check that resolve has *args and **kwargs as parameters
69
- sig = inspect.signature(Facade.resolve)
70
- params = list(sig.parameters.values())
71
- self.assertEqual(params[0].name, "args")
72
- self.assertEqual(params[1].kind, inspect.Parameter.VAR_KEYWORD)
73
-
74
- # Check that __getattr__ has 'cls' and 'name' as parameters
75
- sig = inspect.signature(FacadeMeta.__getattr__)
76
- params = list(sig.parameters.values())
77
- self.assertEqual(params[0].name, "cls")
78
- self.assertEqual(params[1].name, "name")
File without changes