orionis 0.437.0__py3-none-any.whl → 0.439.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/container/context/scope.py +1 -1
- orionis/metadata/framework.py +1 -1
- {orionis-0.437.0.dist-info → orionis-0.439.0.dist-info}/METADATA +1 -1
- {orionis-0.437.0.dist-info → orionis-0.439.0.dist-info}/RECORD +36 -35
- tests/container/context/test_manager.py +1 -0
- tests/container/context/test_scope.py +1 -0
- tests/container/core/__init__.py +0 -0
- tests/container/{test_container.py → core/test_container.py} +45 -1
- tests/container/{test_singleton.py → core/test_singleton.py} +5 -0
- tests/container/{test_thread_safety.py → core/test_thread_safety.py} +2 -0
- tests/container/mocks/mock_complex_classes.py +502 -192
- tests/container/mocks/mock_simple_classes.py +72 -6
- tests/container/validators/test_is_not_subclass.py +0 -1
- tests/container/validators/test_is_valid_alias.py +1 -1
- tests/foundation/config/database/test_foundation_config_database.py +54 -28
- tests/foundation/config/filesystems/test_foundation_config_filesystems_aws.py +40 -22
- tests/foundation/config/filesystems/test_foundation_config_filesystems_public.py +75 -48
- tests/foundation/config/logging/test_foundation_config_logging_channels.py +49 -37
- tests/foundation/config/logging/test_foundation_config_logging_monthly.py +80 -42
- tests/foundation/config/logging/test_foundation_config_logging_stack.py +46 -22
- tests/foundation/config/queue/test_foundation_config_queue_brokers.py +1 -0
- tests/foundation/config/root/test_foundation_config_root_paths.py +37 -44
- tests/foundation/config/session/test_foundation_config_session.py +65 -20
- tests/foundation/config/startup/test_foundation_config_startup.py +37 -34
- tests/services/environment/test_services_environment.py +5 -4
- tests/services/introspection/dependencies/test_reflect_dependencies.py +77 -25
- tests/services/introspection/reflection/mock/fake_reflect_instance.py +750 -267
- tests/services/introspection/reflection/test_reflection_abstract.py +514 -83
- tests/services/introspection/reflection/test_reflection_callable.py +85 -35
- tests/services/introspection/reflection/test_reflection_concrete.py +345 -226
- tests/services/introspection/reflection/test_reflection_instance.py +627 -273
- tests/services/introspection/reflection/test_reflection_module.py +346 -175
- {orionis-0.437.0.dist-info → orionis-0.439.0.dist-info}/WHEEL +0 -0
- {orionis-0.437.0.dist-info → orionis-0.439.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.437.0.dist-info → orionis-0.439.0.dist-info}/top_level.txt +0 -0
- {orionis-0.437.0.dist-info → orionis-0.439.0.dist-info}/zip-safe +0 -0
|
@@ -7,9 +7,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
7
7
|
|
|
8
8
|
async def testGetInstance(self):
|
|
9
9
|
"""
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
Test ReflectionInstance.getInstance() method functionality.
|
|
11
|
+
|
|
12
|
+
Verifies that the getInstance() method returns the wrapped instance object
|
|
13
|
+
correctly. Creates a ReflectionInstance wrapper around a FakeClass object
|
|
14
|
+
and validates that the retrieved instance maintains its original type.
|
|
15
|
+
|
|
16
|
+
Assertions
|
|
17
|
+
----------
|
|
18
|
+
- Retrieved instance is of type FakeClass
|
|
13
19
|
"""
|
|
14
20
|
reflect = ReflectionInstance(FakeClass())
|
|
15
21
|
instance = reflect.getInstance()
|
|
@@ -17,10 +23,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
17
23
|
|
|
18
24
|
async def testGetClass(self):
|
|
19
25
|
"""
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
Test ReflectionInstance.getClass() method functionality.
|
|
27
|
+
|
|
28
|
+
Verifies that the getClass method correctly returns the class type
|
|
29
|
+
of the wrapped instance object. Creates a ReflectionInstance with
|
|
30
|
+
a FakeClass instance and validates the returned class type.
|
|
31
|
+
|
|
32
|
+
Assertions
|
|
33
|
+
----------
|
|
34
|
+
- Returned class equals FakeClass type
|
|
24
35
|
"""
|
|
25
36
|
reflect = ReflectionInstance(FakeClass())
|
|
26
37
|
cls = reflect.getClass()
|
|
@@ -28,9 +39,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
28
39
|
|
|
29
40
|
async def testGetClassName(self):
|
|
30
41
|
"""
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
Test ReflectionInstance.getClassName() method functionality.
|
|
43
|
+
|
|
44
|
+
Verifies that the getClassName method correctly retrieves the string
|
|
45
|
+
name of the wrapped instance's class. Creates a ReflectionInstance
|
|
46
|
+
with a FakeClass object and validates the returned class name.
|
|
47
|
+
|
|
48
|
+
Assertions
|
|
49
|
+
----------
|
|
50
|
+
- Returned class name equals 'FakeClass'
|
|
34
51
|
"""
|
|
35
52
|
reflect = ReflectionInstance(FakeClass())
|
|
36
53
|
class_name = reflect.getClassName()
|
|
@@ -38,12 +55,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
38
55
|
|
|
39
56
|
async def testGetModuleName(self):
|
|
40
57
|
"""
|
|
41
|
-
|
|
42
|
-
for the provided `FakeClass` instance.
|
|
58
|
+
Test ReflectionInstance.getModuleName() method functionality.
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
60
|
+
Verifies that the getModuleName method correctly returns the fully
|
|
61
|
+
qualified module name of the wrapped instance's class. Creates a
|
|
62
|
+
ReflectionInstance with a FakeClass object and validates the module path.
|
|
63
|
+
|
|
64
|
+
Assertions
|
|
65
|
+
----------
|
|
66
|
+
- Returned module name equals 'tests.services.introspection.reflection.mock.fake_reflect_instance'
|
|
47
67
|
"""
|
|
48
68
|
reflect = ReflectionInstance(FakeClass())
|
|
49
69
|
module_name = reflect.getModuleName()
|
|
@@ -51,11 +71,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
51
71
|
|
|
52
72
|
async def testGetModuleWithClassName(self):
|
|
53
73
|
"""
|
|
54
|
-
|
|
55
|
-
|
|
74
|
+
Test ReflectionInstance.getModuleWithClassName() method functionality.
|
|
75
|
+
|
|
76
|
+
Verifies that the getModuleWithClassName method returns the fully qualified
|
|
77
|
+
module path combined with the class name. Creates a ReflectionInstance
|
|
78
|
+
with a FakeClass object and validates the complete module.class path.
|
|
56
79
|
|
|
57
|
-
|
|
58
|
-
|
|
80
|
+
Assertions
|
|
81
|
+
----------
|
|
82
|
+
- Returned string equals 'tests.services.introspection.reflection.mock.fake_reflect_instance.FakeClass'
|
|
59
83
|
"""
|
|
60
84
|
reflect = ReflectionInstance(FakeClass())
|
|
61
85
|
module_with_class_name = reflect.getModuleWithClassName()
|
|
@@ -63,8 +87,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
63
87
|
|
|
64
88
|
async def testGetDocstring(self):
|
|
65
89
|
"""
|
|
66
|
-
Test
|
|
67
|
-
|
|
90
|
+
Test ReflectionInstance.getDocstring() method functionality.
|
|
91
|
+
|
|
92
|
+
Verifies that the getDocstring method correctly retrieves the docstring
|
|
93
|
+
of the wrapped instance's class. Creates a ReflectionInstance with a
|
|
94
|
+
FakeClass object and compares the returned docstring with the class's __doc__.
|
|
95
|
+
|
|
96
|
+
Assertions
|
|
97
|
+
----------
|
|
98
|
+
- Returned docstring equals FakeClass.__doc__
|
|
68
99
|
"""
|
|
69
100
|
reflect = ReflectionInstance(FakeClass())
|
|
70
101
|
docstring = reflect.getDocstring()
|
|
@@ -72,11 +103,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
72
103
|
|
|
73
104
|
async def testGetBaseClasses(self):
|
|
74
105
|
"""
|
|
75
|
-
|
|
76
|
-
|
|
106
|
+
Test ReflectionInstance.getBaseClasses() method functionality.
|
|
107
|
+
|
|
108
|
+
Verifies that the getBaseClasses method correctly retrieves the base
|
|
109
|
+
classes of the wrapped instance's class. Creates a ReflectionInstance
|
|
110
|
+
with a FakeClass object and validates that the base class is included.
|
|
77
111
|
|
|
78
|
-
|
|
79
|
-
|
|
112
|
+
Assertions
|
|
113
|
+
----------
|
|
114
|
+
- FakeClass.__base__ is present in the returned base classes list
|
|
80
115
|
"""
|
|
81
116
|
reflect = ReflectionInstance(FakeClass())
|
|
82
117
|
base_classes = reflect.getBaseClasses()
|
|
@@ -84,9 +119,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
84
119
|
|
|
85
120
|
async def testGetSourceCode(self):
|
|
86
121
|
"""
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
122
|
+
Test ReflectionInstance.getSourceCode() method functionality.
|
|
123
|
+
|
|
124
|
+
Verifies that the getSourceCode method correctly retrieves the source
|
|
125
|
+
code of the wrapped instance's class. Creates a ReflectionInstance
|
|
126
|
+
with a FakeClass object and validates the source code content.
|
|
127
|
+
|
|
128
|
+
Assertions
|
|
129
|
+
----------
|
|
130
|
+
- Returned source code starts with 'class FakeClass'
|
|
90
131
|
"""
|
|
91
132
|
reflect = ReflectionInstance(FakeClass())
|
|
92
133
|
source_code = reflect.getSourceCode()
|
|
@@ -94,8 +135,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
94
135
|
|
|
95
136
|
async def testGetFile(self):
|
|
96
137
|
"""
|
|
97
|
-
|
|
98
|
-
|
|
138
|
+
Test ReflectionInstance.getFile() method functionality.
|
|
139
|
+
|
|
140
|
+
Verifies that the getFile method correctly returns the file path
|
|
141
|
+
of the wrapped instance's class definition. Creates a ReflectionInstance
|
|
142
|
+
with a FakeClass object and validates the returned file path.
|
|
143
|
+
|
|
144
|
+
Assertions
|
|
145
|
+
----------
|
|
146
|
+
- Returned file path ends with 'fake_reflect_instance.py'
|
|
99
147
|
"""
|
|
100
148
|
reflect = ReflectionInstance(FakeClass())
|
|
101
149
|
file_path = reflect.getFile()
|
|
@@ -103,9 +151,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
103
151
|
|
|
104
152
|
async def testGetAnnotations(self):
|
|
105
153
|
"""
|
|
106
|
-
Test
|
|
107
|
-
|
|
108
|
-
|
|
154
|
+
Test ReflectionInstance.getAnnotations() method functionality.
|
|
155
|
+
|
|
156
|
+
Verifies that the getAnnotations method correctly returns the type
|
|
157
|
+
annotations of the wrapped instance's class. Creates a ReflectionInstance
|
|
158
|
+
with a FakeClass object and validates the presence of expected annotations.
|
|
159
|
+
|
|
160
|
+
Assertions
|
|
161
|
+
----------
|
|
162
|
+
- 'public_attr' annotation is present in the returned annotations
|
|
109
163
|
"""
|
|
110
164
|
reflect = ReflectionInstance(FakeClass())
|
|
111
165
|
annotations = reflect.getAnnotations()
|
|
@@ -113,10 +167,16 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
113
167
|
|
|
114
168
|
async def testHasAttribute(self):
|
|
115
169
|
"""
|
|
116
|
-
|
|
170
|
+
Test ReflectionInstance.hasAttribute() method functionality.
|
|
171
|
+
|
|
172
|
+
Verifies that the hasAttribute method correctly identifies the presence
|
|
173
|
+
or absence of attributes on the wrapped instance. Tests both existing
|
|
174
|
+
and non-existing attributes to validate proper boolean responses.
|
|
117
175
|
|
|
118
|
-
|
|
119
|
-
|
|
176
|
+
Assertions
|
|
177
|
+
----------
|
|
178
|
+
- Returns True for existing attribute 'public_attr'
|
|
179
|
+
- Returns False for non-existent attribute 'non_existent_attr'
|
|
120
180
|
"""
|
|
121
181
|
reflect = ReflectionInstance(FakeClass())
|
|
122
182
|
self.assertTrue(reflect.hasAttribute('public_attr'))
|
|
@@ -124,11 +184,16 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
124
184
|
|
|
125
185
|
async def testGetAttribute(self):
|
|
126
186
|
"""
|
|
127
|
-
|
|
187
|
+
Test ReflectionInstance.getAttribute() method functionality.
|
|
188
|
+
|
|
189
|
+
Verifies that the getAttribute method correctly retrieves attribute
|
|
190
|
+
values from the wrapped instance. Tests both existing attributes
|
|
191
|
+
and non-existent attributes to validate proper value retrieval.
|
|
128
192
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
-
|
|
193
|
+
Assertions
|
|
194
|
+
----------
|
|
195
|
+
- Returns correct value (42) for existing attribute 'public_attr'
|
|
196
|
+
- Returns None for non-existent attribute 'non_existent_attr'
|
|
132
197
|
"""
|
|
133
198
|
reflect = ReflectionInstance(FakeClass())
|
|
134
199
|
self.assertEqual(reflect.getAttribute('public_attr'), 42)
|
|
@@ -136,19 +201,20 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
136
201
|
|
|
137
202
|
async def testSetAttribute(self):
|
|
138
203
|
"""
|
|
139
|
-
Test
|
|
204
|
+
Test ReflectionInstance.setAttribute() method functionality.
|
|
140
205
|
|
|
141
|
-
|
|
142
|
-
on the wrapped
|
|
143
|
-
|
|
206
|
+
Verifies that the setAttribute method correctly sets attribute values
|
|
207
|
+
on the wrapped instance, including public, protected, and private attributes.
|
|
208
|
+
Also validates that the updated values can be retrieved using getAttribute.
|
|
144
209
|
|
|
145
|
-
Assertions
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
210
|
+
Assertions
|
|
211
|
+
----------
|
|
212
|
+
- setAttribute returns True when setting public attribute 'name'
|
|
213
|
+
- Public attribute value is updated correctly to 'Orionis Framework'
|
|
214
|
+
- setAttribute returns True when setting protected attribute '_version'
|
|
215
|
+
- Protected attribute value is updated correctly to '1.x'
|
|
216
|
+
- setAttribute returns True when setting private attribute '__python'
|
|
217
|
+
- Private attribute value is updated correctly to '3.13+'
|
|
152
218
|
"""
|
|
153
219
|
reflect = ReflectionInstance(FakeClass())
|
|
154
220
|
self.assertTrue(reflect.setAttribute('name', 'Orionis Framework'))
|
|
@@ -160,8 +226,16 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
160
226
|
|
|
161
227
|
async def testRemoveAttribute(self):
|
|
162
228
|
"""
|
|
163
|
-
Test
|
|
164
|
-
|
|
229
|
+
Test ReflectionInstance.removeAttribute() method functionality.
|
|
230
|
+
|
|
231
|
+
Verifies that the removeAttribute method successfully removes an attribute
|
|
232
|
+
from the wrapped instance. Tests the removal process by first setting
|
|
233
|
+
an attribute, then removing it, and validating its absence.
|
|
234
|
+
|
|
235
|
+
Assertions
|
|
236
|
+
----------
|
|
237
|
+
- removeAttribute returns True when removing an existing attribute
|
|
238
|
+
- Attribute is no longer present after removal (hasAttribute returns False)
|
|
165
239
|
"""
|
|
166
240
|
reflect = ReflectionInstance(FakeClass())
|
|
167
241
|
reflect.setAttribute('new_attr', 100)
|
|
@@ -170,9 +244,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
170
244
|
|
|
171
245
|
async def testGetAttributes(self):
|
|
172
246
|
"""
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
247
|
+
Test ReflectionInstance.getAttributes() method functionality.
|
|
248
|
+
|
|
249
|
+
Verifies that the getAttributes method correctly retrieves all attribute
|
|
250
|
+
names from the wrapped instance, including public, protected, and private
|
|
251
|
+
attributes. Tests comprehensive attribute visibility.
|
|
252
|
+
|
|
253
|
+
Assertions
|
|
254
|
+
----------
|
|
255
|
+
- 'public_attr' is present in the returned attributes list
|
|
256
|
+
- '_protected_attr' is present in the returned attributes list
|
|
257
|
+
- '__private_attr' is present in the returned attributes list
|
|
176
258
|
"""
|
|
177
259
|
reflect = ReflectionInstance(FakeClass())
|
|
178
260
|
attributes = reflect.getAttributes()
|
|
@@ -182,12 +264,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
182
264
|
|
|
183
265
|
async def testGetPublicAttributes(self):
|
|
184
266
|
"""
|
|
185
|
-
Test
|
|
267
|
+
Test ReflectionInstance.getPublicAttributes() method functionality.
|
|
268
|
+
|
|
269
|
+
Verifies that the getPublicAttributes method returns only public attributes
|
|
270
|
+
of the wrapped instance, excluding protected and private attributes. Tests
|
|
271
|
+
proper visibility filtering based on Python naming conventions.
|
|
186
272
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
273
|
+
Assertions
|
|
274
|
+
----------
|
|
275
|
+
- 'public_attr' is included in the returned list
|
|
276
|
+
- '_protected_attr' is not included in the returned list
|
|
277
|
+
- '__private_attr' is not included in the returned list
|
|
191
278
|
"""
|
|
192
279
|
reflect = ReflectionInstance(FakeClass())
|
|
193
280
|
public_attributes = reflect.getPublicAttributes()
|
|
@@ -197,12 +284,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
197
284
|
|
|
198
285
|
async def testGetProtectedAttributes(self):
|
|
199
286
|
"""
|
|
200
|
-
Test
|
|
287
|
+
Test ReflectionInstance.getProtectedAttributes() method functionality.
|
|
201
288
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
289
|
+
Verifies that the getProtectedAttributes method correctly identifies and
|
|
290
|
+
returns only protected attributes (prefixed with single underscore) of
|
|
291
|
+
the wrapped instance, excluding public and private attributes.
|
|
292
|
+
|
|
293
|
+
Assertions
|
|
294
|
+
----------
|
|
295
|
+
- '_protected_attr' is included in the returned list
|
|
296
|
+
- 'public_attr' is not included in the returned list
|
|
297
|
+
- '__private_attr' is not included in the returned list
|
|
206
298
|
"""
|
|
207
299
|
reflect = ReflectionInstance(FakeClass())
|
|
208
300
|
protected_attributes = reflect.getProtectedAttributes()
|
|
@@ -212,12 +304,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
212
304
|
|
|
213
305
|
async def testGetPrivateAttributes(self):
|
|
214
306
|
"""
|
|
215
|
-
Test
|
|
307
|
+
Test ReflectionInstance.getPrivateAttributes() method functionality.
|
|
308
|
+
|
|
309
|
+
Verifies that the getPrivateAttributes method correctly identifies and
|
|
310
|
+
returns only private attributes (prefixed with double underscores) of
|
|
311
|
+
the wrapped instance, excluding public and protected attributes.
|
|
216
312
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
313
|
+
Assertions
|
|
314
|
+
----------
|
|
315
|
+
- '__private_attr' is included in the returned list
|
|
316
|
+
- 'public_attr' is not included in the returned list
|
|
317
|
+
- '_protected_attr' is not included in the returned list
|
|
221
318
|
"""
|
|
222
319
|
reflect = ReflectionInstance(FakeClass())
|
|
223
320
|
private_attributes = reflect.getPrivateAttributes()
|
|
@@ -227,10 +324,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
227
324
|
|
|
228
325
|
async def testGetDunderAttributes(self):
|
|
229
326
|
"""
|
|
230
|
-
|
|
231
|
-
|
|
327
|
+
Test ReflectionInstance.getDunderAttributes() method functionality.
|
|
328
|
+
|
|
329
|
+
Verifies that the getDunderAttributes method correctly retrieves all
|
|
330
|
+
double underscore (dunder) attributes from the wrapped instance. Tests
|
|
331
|
+
the identification of special attributes with the dunder naming pattern.
|
|
232
332
|
|
|
233
|
-
|
|
333
|
+
Assertions
|
|
334
|
+
----------
|
|
335
|
+
- '__dd__' is present in the returned list of dunder attributes
|
|
234
336
|
"""
|
|
235
337
|
reflect = ReflectionInstance(FakeClass())
|
|
236
338
|
dunder_attributes = reflect.getDunderAttributes()
|
|
@@ -238,8 +340,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
238
340
|
|
|
239
341
|
async def testGetMagicAttributes(self):
|
|
240
342
|
"""
|
|
241
|
-
|
|
242
|
-
|
|
343
|
+
Test ReflectionInstance.getMagicAttributes() method functionality.
|
|
344
|
+
|
|
345
|
+
Verifies that the getMagicAttributes method returns a list of magic attributes
|
|
346
|
+
(special methods and attributes with double underscores) for the wrapped instance.
|
|
347
|
+
Tests the identification of Python magic/special attributes.
|
|
348
|
+
|
|
349
|
+
Assertions
|
|
350
|
+
----------
|
|
351
|
+
- '__dd__' is present in the returned list of magic attributes
|
|
243
352
|
"""
|
|
244
353
|
reflect = ReflectionInstance(FakeClass())
|
|
245
354
|
magic_attributes = reflect.getMagicAttributes()
|
|
@@ -247,11 +356,16 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
247
356
|
|
|
248
357
|
async def testHasMethod(self):
|
|
249
358
|
"""
|
|
250
|
-
|
|
359
|
+
Test ReflectionInstance.hasMethod() method functionality.
|
|
360
|
+
|
|
361
|
+
Verifies that the hasMethod method correctly identifies the presence
|
|
362
|
+
or absence of methods on the wrapped instance. Tests both existing
|
|
363
|
+
and non-existing methods to validate proper boolean responses.
|
|
251
364
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
'
|
|
365
|
+
Assertions
|
|
366
|
+
----------
|
|
367
|
+
- Returns True for existing method 'instanceSyncMethod'
|
|
368
|
+
- Returns False for non-existent method 'non_existent_method'
|
|
255
369
|
"""
|
|
256
370
|
reflect = ReflectionInstance(FakeClass())
|
|
257
371
|
self.assertTrue(reflect.hasMethod('instanceSyncMethod'))
|
|
@@ -259,10 +373,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
259
373
|
|
|
260
374
|
async def testCallMethod(self):
|
|
261
375
|
"""
|
|
262
|
-
|
|
376
|
+
Test ReflectionInstance.callMethod() synchronous method functionality.
|
|
263
377
|
|
|
264
|
-
|
|
265
|
-
|
|
378
|
+
Verifies that the callMethod method correctly invokes synchronous methods
|
|
379
|
+
on the wrapped instance with arguments and returns the expected result.
|
|
380
|
+
Tests method execution through reflection with parameter passing.
|
|
381
|
+
|
|
382
|
+
Assertions
|
|
383
|
+
----------
|
|
384
|
+
- Calling 'instanceSyncMethod' with arguments 2 and 3 returns 5
|
|
266
385
|
"""
|
|
267
386
|
reflect = ReflectionInstance(FakeClass())
|
|
268
387
|
result = reflect.callMethod('instanceSyncMethod', 2, 3)
|
|
@@ -270,11 +389,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
270
389
|
|
|
271
390
|
async def testCallAsyncMethod(self):
|
|
272
391
|
"""
|
|
273
|
-
|
|
274
|
-
|
|
392
|
+
Test ReflectionInstance.callMethod() asynchronous method functionality.
|
|
393
|
+
|
|
394
|
+
Verifies that the callMethod method correctly invokes asynchronous methods
|
|
395
|
+
on the wrapped instance with arguments and returns the expected result.
|
|
396
|
+
Tests async method execution through reflection with parameter passing.
|
|
275
397
|
|
|
276
|
-
|
|
277
|
-
|
|
398
|
+
Assertions
|
|
399
|
+
----------
|
|
400
|
+
- Calling 'instanceAsyncMethod' with arguments 2 and 3 returns 5
|
|
278
401
|
"""
|
|
279
402
|
reflect = ReflectionInstance(FakeClass())
|
|
280
403
|
result = await reflect.callMethod('instanceAsyncMethod', 2, 3)
|
|
@@ -282,13 +405,16 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
282
405
|
|
|
283
406
|
async def testSetMethod(self):
|
|
284
407
|
"""
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
408
|
+
Test ReflectionInstance.setMethod() method functionality.
|
|
409
|
+
|
|
410
|
+
Verifies that the setMethod method can dynamically add both synchronous
|
|
411
|
+
and asynchronous methods to the wrapped instance. Tests the ability to
|
|
412
|
+
set custom methods and then call them through the reflection interface.
|
|
413
|
+
|
|
414
|
+
Assertions
|
|
415
|
+
----------
|
|
416
|
+
- Synchronous mock method returns expected result (5) when called with arguments 2 and 3
|
|
417
|
+
- Asynchronous mock method returns expected result (5) when called with arguments 2 and 3
|
|
292
418
|
"""
|
|
293
419
|
|
|
294
420
|
def mockSyncMethod(cls:FakeClass, num1, num2):
|
|
@@ -309,9 +435,16 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
309
435
|
|
|
310
436
|
async def testRemoveMethod(self):
|
|
311
437
|
"""
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
438
|
+
Test ReflectionInstance.removeMethod() method functionality.
|
|
439
|
+
|
|
440
|
+
Verifies that the removeMethod method can successfully remove dynamically
|
|
441
|
+
added methods from the wrapped instance. Tests the process of adding a
|
|
442
|
+
method, confirming its existence, removing it, and validating its absence.
|
|
443
|
+
|
|
444
|
+
Assertions
|
|
445
|
+
----------
|
|
446
|
+
- Method exists after being added (hasMethod returns True)
|
|
447
|
+
- Method no longer exists after removal (hasMethod returns False)
|
|
315
448
|
"""
|
|
316
449
|
def _testProtectedMethod(cls:FakeClass, x, y):
|
|
317
450
|
return x + y
|
|
@@ -327,10 +460,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
327
460
|
|
|
328
461
|
async def testGetMethodSignature(self):
|
|
329
462
|
"""
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
463
|
+
Test ReflectionInstance.getMethodSignature() method functionality.
|
|
464
|
+
|
|
465
|
+
Verifies that the getMethodSignature method correctly retrieves the
|
|
466
|
+
signature of a specified method from the wrapped instance. Tests
|
|
467
|
+
signature inspection and string representation of method parameters.
|
|
468
|
+
|
|
469
|
+
Assertions
|
|
470
|
+
----------
|
|
471
|
+
- Signature of 'instanceSyncMethod' equals '(self, x: int, y: int) -> int'
|
|
334
472
|
"""
|
|
335
473
|
reflect = ReflectionInstance(FakeClass())
|
|
336
474
|
signature = reflect.getMethodSignature('instanceSyncMethod')
|
|
@@ -338,9 +476,16 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
338
476
|
|
|
339
477
|
async def testGetMethods(self):
|
|
340
478
|
"""
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
479
|
+
Test ReflectionInstance.getMethods() method functionality.
|
|
480
|
+
|
|
481
|
+
Verifies that the getMethods method correctly retrieves the names of all
|
|
482
|
+
instance methods from the wrapped instance, including both synchronous
|
|
483
|
+
and asynchronous methods. Tests comprehensive method discovery.
|
|
484
|
+
|
|
485
|
+
Assertions
|
|
486
|
+
----------
|
|
487
|
+
- 'instanceSyncMethod' is present in the returned methods list
|
|
488
|
+
- 'instanceAsyncMethod' is present in the returned methods list
|
|
344
489
|
"""
|
|
345
490
|
reflect = ReflectionInstance(FakeClass())
|
|
346
491
|
methods = reflect.getMethods()
|
|
@@ -349,11 +494,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
349
494
|
|
|
350
495
|
async def testGetPublicMethods(self):
|
|
351
496
|
"""
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
497
|
+
Test ReflectionInstance.getPublicMethods() method functionality.
|
|
498
|
+
|
|
499
|
+
Verifies that the getPublicMethods method returns only public methods
|
|
500
|
+
of the wrapped instance, excluding protected and private methods. Tests
|
|
501
|
+
method visibility filtering based on Python naming conventions.
|
|
502
|
+
|
|
503
|
+
Assertions
|
|
504
|
+
----------
|
|
505
|
+
- 'instanceSyncMethod' is included in the returned list
|
|
506
|
+
- '_protected_method' is not included in the returned list
|
|
507
|
+
- '__private_method' is not included in the returned list
|
|
357
508
|
"""
|
|
358
509
|
reflect = ReflectionInstance(FakeClass())
|
|
359
510
|
public_methods = reflect.getPublicMethods()
|
|
@@ -363,12 +514,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
363
514
|
|
|
364
515
|
async def testGetPublicSyncMethods(self):
|
|
365
516
|
"""
|
|
366
|
-
Test
|
|
517
|
+
Test ReflectionInstance.getPublicSyncMethods() method functionality.
|
|
367
518
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
519
|
+
Verifies that the getPublicSyncMethods method returns only the names of
|
|
520
|
+
public synchronous methods from the wrapped instance, excluding protected
|
|
521
|
+
and private methods. Tests synchronous method filtering with visibility.
|
|
522
|
+
|
|
523
|
+
Assertions
|
|
524
|
+
----------
|
|
525
|
+
- 'instanceSyncMethod' is included in the returned list
|
|
526
|
+
- '_protected_method' is not included in the returned list
|
|
527
|
+
- '__private_method' is not included in the returned list
|
|
372
528
|
"""
|
|
373
529
|
reflect = ReflectionInstance(FakeClass())
|
|
374
530
|
public_sync_methods = reflect.getPublicSyncMethods()
|
|
@@ -378,11 +534,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
378
534
|
|
|
379
535
|
async def testGetPublicAsyncMethods(self):
|
|
380
536
|
"""
|
|
381
|
-
Test
|
|
537
|
+
Test ReflectionInstance.getPublicAsyncMethods() method functionality.
|
|
538
|
+
|
|
539
|
+
Verifies that the getPublicAsyncMethods method correctly identifies and
|
|
540
|
+
returns only public asynchronous methods from the wrapped instance,
|
|
541
|
+
excluding protected and private async methods.
|
|
382
542
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
-
|
|
543
|
+
Assertions
|
|
544
|
+
----------
|
|
545
|
+
- 'instanceAsyncMethod' is included in the returned list
|
|
546
|
+
- '_protected_async_method' is not included in the returned list
|
|
547
|
+
- '__private_async_method' is not included in the returned list
|
|
386
548
|
"""
|
|
387
549
|
reflect = ReflectionInstance(FakeClass())
|
|
388
550
|
public_async_methods = reflect.getPublicAsyncMethods()
|
|
@@ -392,12 +554,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
392
554
|
|
|
393
555
|
async def testGetProtectedMethods(self):
|
|
394
556
|
"""
|
|
395
|
-
Test
|
|
557
|
+
Test ReflectionInstance.getProtectedMethods() method functionality.
|
|
558
|
+
|
|
559
|
+
Verifies that the getProtectedMethods method correctly identifies and
|
|
560
|
+
returns only protected methods (prefixed with single underscore) from
|
|
561
|
+
the wrapped instance, excluding public and private methods.
|
|
396
562
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
-
|
|
400
|
-
-
|
|
563
|
+
Assertions
|
|
564
|
+
----------
|
|
565
|
+
- '_protectedAsyncMethod' is included in the returned list
|
|
566
|
+
- 'instanceSyncMethod' is not included in the returned list
|
|
567
|
+
- '__privateSyncMethod' is not included in the returned list
|
|
401
568
|
"""
|
|
402
569
|
reflect = ReflectionInstance(FakeClass())
|
|
403
570
|
protected_methods = reflect.getProtectedMethods()
|
|
@@ -407,11 +574,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
407
574
|
|
|
408
575
|
async def testGetProtectedSyncMethods(self):
|
|
409
576
|
"""
|
|
410
|
-
Test
|
|
577
|
+
Test ReflectionInstance.getProtectedSyncMethods() method functionality.
|
|
411
578
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
579
|
+
Verifies that the getProtectedSyncMethods method correctly identifies and
|
|
580
|
+
returns only protected synchronous methods (prefixed with single underscore)
|
|
581
|
+
from the wrapped instance, excluding async and private methods.
|
|
582
|
+
|
|
583
|
+
Assertions
|
|
584
|
+
----------
|
|
585
|
+
- '_protectedsyncMethod' is included in the returned list
|
|
586
|
+
- 'instanceAsyncMethod' is not included in the returned list
|
|
587
|
+
- '__privateSyncMethod' is not included in the returned list
|
|
415
588
|
"""
|
|
416
589
|
reflect = ReflectionInstance(FakeClass())
|
|
417
590
|
protected_sync_methods = reflect.getProtectedSyncMethods()
|
|
@@ -421,12 +594,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
421
594
|
|
|
422
595
|
async def testGetProtectedAsyncMethods(self):
|
|
423
596
|
"""
|
|
424
|
-
Test
|
|
597
|
+
Test ReflectionInstance.getProtectedAsyncMethods() method functionality.
|
|
598
|
+
|
|
599
|
+
Verifies that the getProtectedAsyncMethods method correctly identifies and
|
|
600
|
+
returns only protected asynchronous methods (prefixed with single underscore)
|
|
601
|
+
from the wrapped instance, excluding public and private methods.
|
|
425
602
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
-
|
|
429
|
-
-
|
|
603
|
+
Assertions
|
|
604
|
+
----------
|
|
605
|
+
- '_protectedAsyncMethod' is included in the returned list
|
|
606
|
+
- 'instanceSyncMethod' is not included in the returned list
|
|
607
|
+
- '__privateSyncMethod' is not included in the returned list
|
|
430
608
|
"""
|
|
431
609
|
reflect = ReflectionInstance(FakeClass())
|
|
432
610
|
protected_async_methods = reflect.getProtectedAsyncMethods()
|
|
@@ -436,12 +614,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
436
614
|
|
|
437
615
|
async def testGetPrivateMethods(self):
|
|
438
616
|
"""
|
|
439
|
-
Test
|
|
617
|
+
Test ReflectionInstance.getPrivateMethods() method functionality.
|
|
618
|
+
|
|
619
|
+
Verifies that the getPrivateMethods method correctly identifies and
|
|
620
|
+
returns only private methods (prefixed with double underscores) from
|
|
621
|
+
the wrapped instance, excluding public and protected methods.
|
|
440
622
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
-
|
|
444
|
-
-
|
|
623
|
+
Assertions
|
|
624
|
+
----------
|
|
625
|
+
- '__privateSyncMethod' is included in the returned list
|
|
626
|
+
- 'instanceSyncMethod' is not included in the returned list
|
|
627
|
+
- '_protectedAsyncMethod' is not included in the returned list
|
|
445
628
|
"""
|
|
446
629
|
reflect = ReflectionInstance(FakeClass())
|
|
447
630
|
private_methods = reflect.getPrivateMethods()
|
|
@@ -451,11 +634,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
451
634
|
|
|
452
635
|
async def testGetPrivateSyncMethods(self):
|
|
453
636
|
"""
|
|
454
|
-
Test
|
|
637
|
+
Test ReflectionInstance.getPrivateSyncMethods() method functionality.
|
|
455
638
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
639
|
+
Verifies that the getPrivateSyncMethods method correctly identifies and
|
|
640
|
+
returns only private synchronous methods (prefixed with double underscores)
|
|
641
|
+
from the wrapped instance, excluding async and protected methods.
|
|
642
|
+
|
|
643
|
+
Assertions
|
|
644
|
+
----------
|
|
645
|
+
- '__privateSyncMethod' is included in the returned list
|
|
646
|
+
- 'instanceAsyncMethod' is not included in the returned list
|
|
647
|
+
- '_protectedAsyncMethod' is not included in the returned list
|
|
459
648
|
"""
|
|
460
649
|
reflect = ReflectionInstance(FakeClass())
|
|
461
650
|
private_sync_methods = reflect.getPrivateSyncMethods()
|
|
@@ -465,12 +654,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
465
654
|
|
|
466
655
|
async def testGetPrivateAsyncMethods(self):
|
|
467
656
|
"""
|
|
468
|
-
Test
|
|
657
|
+
Test ReflectionInstance.getPrivateAsyncMethods() method functionality.
|
|
658
|
+
|
|
659
|
+
Verifies that the getPrivateAsyncMethods method correctly identifies and
|
|
660
|
+
returns only private asynchronous methods (prefixed with double underscores)
|
|
661
|
+
from the wrapped instance, excluding public and protected methods.
|
|
469
662
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
-
|
|
473
|
-
-
|
|
663
|
+
Assertions
|
|
664
|
+
----------
|
|
665
|
+
- '__privateAsyncMethod' is included in the returned list
|
|
666
|
+
- 'instanceSyncMethod' is not included in the returned list
|
|
667
|
+
- '_protectedAsyncMethod' is not included in the returned list
|
|
474
668
|
"""
|
|
475
669
|
reflect = ReflectionInstance(FakeClass())
|
|
476
670
|
private_async_methods = reflect.getPrivateAsyncMethods()
|
|
@@ -480,11 +674,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
480
674
|
|
|
481
675
|
async def testGetPublicClassMethods(self):
|
|
482
676
|
"""
|
|
483
|
-
Test
|
|
677
|
+
Test ReflectionInstance.getPublicClassMethods() method functionality.
|
|
678
|
+
|
|
679
|
+
Verifies that the getPublicClassMethods method correctly identifies and
|
|
680
|
+
returns only public class methods from the wrapped instance, excluding
|
|
681
|
+
protected and private class methods.
|
|
484
682
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
-
|
|
683
|
+
Assertions
|
|
684
|
+
----------
|
|
685
|
+
- 'classSyncMethod' is included in the returned list
|
|
686
|
+
- '_protected_class_method' is not included in the returned list
|
|
687
|
+
- '__private_class_method' is not included in the returned list
|
|
488
688
|
"""
|
|
489
689
|
reflect = ReflectionInstance(FakeClass())
|
|
490
690
|
public_class_methods = reflect.getPublicClassMethods()
|
|
@@ -494,11 +694,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
494
694
|
|
|
495
695
|
async def testGetPublicClassSyncMethods(self):
|
|
496
696
|
"""
|
|
497
|
-
Test
|
|
697
|
+
Test ReflectionInstance.getPublicClassSyncMethods() method functionality.
|
|
498
698
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
699
|
+
Verifies that the getPublicClassSyncMethods method correctly identifies and
|
|
700
|
+
returns only public synchronous class methods from the wrapped instance,
|
|
701
|
+
excluding protected and private class methods.
|
|
702
|
+
|
|
703
|
+
Assertions
|
|
704
|
+
----------
|
|
705
|
+
- 'classSyncMethod' is included in the returned list
|
|
706
|
+
- '_protected_class_method' is not included in the returned list
|
|
707
|
+
- '__private_class_method' is not included in the returned list
|
|
502
708
|
"""
|
|
503
709
|
reflect = ReflectionInstance(FakeClass())
|
|
504
710
|
public_class_sync_methods = reflect.getPublicClassSyncMethods()
|
|
@@ -508,11 +714,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
508
714
|
|
|
509
715
|
async def testGetPublicClassAsyncMethods(self):
|
|
510
716
|
"""
|
|
511
|
-
Test
|
|
717
|
+
Test ReflectionInstance.getPublicClassAsyncMethods() method functionality.
|
|
718
|
+
|
|
719
|
+
Verifies that the getPublicClassAsyncMethods method correctly identifies and
|
|
720
|
+
returns only public asynchronous class methods from the wrapped instance,
|
|
721
|
+
excluding protected and private async class methods.
|
|
512
722
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
-
|
|
723
|
+
Assertions
|
|
724
|
+
----------
|
|
725
|
+
- 'classAsyncMethod' is included in the returned list
|
|
726
|
+
- '_protected_class_async_method' is not included in the returned list
|
|
727
|
+
- '__private_class_async_method' is not included in the returned list
|
|
516
728
|
"""
|
|
517
729
|
reflect = ReflectionInstance(FakeClass())
|
|
518
730
|
public_class_async_methods = reflect.getPublicClassAsyncMethods()
|
|
@@ -522,12 +734,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
522
734
|
|
|
523
735
|
async def testGetProtectedClassMethods(self):
|
|
524
736
|
"""
|
|
525
|
-
Test
|
|
737
|
+
Test ReflectionInstance.getProtectedClassMethods() method functionality.
|
|
526
738
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
739
|
+
Verifies that the getProtectedClassMethods method correctly identifies and
|
|
740
|
+
returns only protected class methods (prefixed with single underscore) from
|
|
741
|
+
the wrapped instance, excluding public and private class methods.
|
|
742
|
+
|
|
743
|
+
Assertions
|
|
744
|
+
----------
|
|
745
|
+
- '_classMethodProtected' is included in the returned list
|
|
746
|
+
- 'classSyncMethod' is not included in the returned list
|
|
747
|
+
- '__classMethodPrivate' is not included in the returned list
|
|
531
748
|
"""
|
|
532
749
|
reflect = ReflectionInstance(FakeClass())
|
|
533
750
|
protected_class_methods = reflect.getProtectedClassMethods()
|
|
@@ -537,13 +754,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
537
754
|
|
|
538
755
|
async def testGetProtectedClassSyncMethods(self):
|
|
539
756
|
"""
|
|
540
|
-
Test
|
|
541
|
-
|
|
757
|
+
Test ReflectionInstance.getProtectedClassSyncMethods() method functionality.
|
|
758
|
+
|
|
759
|
+
Verifies that the getProtectedClassSyncMethods method correctly identifies and
|
|
760
|
+
returns only protected synchronous class methods (prefixed with single underscore)
|
|
761
|
+
from the wrapped instance, excluding public and private class methods.
|
|
542
762
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
763
|
+
Assertions
|
|
764
|
+
----------
|
|
765
|
+
- '_classMethodProtected' is included in the returned list
|
|
766
|
+
- 'classSyncMethod' is not included in the returned list
|
|
767
|
+
- '__classSyncMethodPrivate' is not included in the returned list
|
|
547
768
|
"""
|
|
548
769
|
reflect = ReflectionInstance(FakeClass())
|
|
549
770
|
protected_class_sync_methods = reflect.getProtectedClassSyncMethods()
|
|
@@ -553,12 +774,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
553
774
|
|
|
554
775
|
async def testGetProtectedClassAsyncMethods(self):
|
|
555
776
|
"""
|
|
556
|
-
Test
|
|
777
|
+
Test ReflectionInstance.getProtectedClassAsyncMethods() method functionality.
|
|
778
|
+
|
|
779
|
+
Verifies that the getProtectedClassAsyncMethods method correctly identifies and
|
|
780
|
+
returns only protected asynchronous class methods (prefixed with single underscore)
|
|
781
|
+
from the wrapped instance, excluding public and private async class methods.
|
|
557
782
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
-
|
|
561
|
-
-
|
|
783
|
+
Assertions
|
|
784
|
+
----------
|
|
785
|
+
- '_classAsyncMethodProtected' is included in the returned list
|
|
786
|
+
- 'classAsyncMethod' is not included in the returned list
|
|
787
|
+
- '__classAsyncMethodPrivate' is not included in the returned list
|
|
562
788
|
"""
|
|
563
789
|
reflect = ReflectionInstance(FakeClass())
|
|
564
790
|
protected_class_async_methods = reflect.getProtectedClassAsyncMethods()
|
|
@@ -568,12 +794,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
568
794
|
|
|
569
795
|
async def testGetPrivateClassMethods(self):
|
|
570
796
|
"""
|
|
571
|
-
Test
|
|
797
|
+
Test ReflectionInstance.getPrivateClassMethods() method functionality.
|
|
572
798
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
799
|
+
Verifies that the getPrivateClassMethods method correctly identifies and
|
|
800
|
+
returns only private class methods (prefixed with double underscores) from
|
|
801
|
+
the wrapped instance, excluding public and protected class methods.
|
|
802
|
+
|
|
803
|
+
Assertions
|
|
804
|
+
----------
|
|
805
|
+
- '__classMethodPrivate' is included in the returned list
|
|
806
|
+
- 'classSyncMethod' is not included in the returned list
|
|
807
|
+
- '_classMethodProtected' is not included in the returned list
|
|
577
808
|
"""
|
|
578
809
|
reflect = ReflectionInstance(FakeClass())
|
|
579
810
|
private_class_methods = reflect.getPrivateClassMethods()
|
|
@@ -583,12 +814,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
583
814
|
|
|
584
815
|
async def testGetPrivateClassSyncMethods(self):
|
|
585
816
|
"""
|
|
586
|
-
Test
|
|
817
|
+
Test ReflectionInstance.getPrivateClassSyncMethods() method functionality.
|
|
818
|
+
|
|
819
|
+
Verifies that the getPrivateClassSyncMethods method correctly identifies and
|
|
820
|
+
returns only private synchronous class methods (prefixed with double underscores)
|
|
821
|
+
from the wrapped instance, excluding public and protected class methods.
|
|
587
822
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
-
|
|
591
|
-
-
|
|
823
|
+
Assertions
|
|
824
|
+
----------
|
|
825
|
+
- '__classMethodPrivate' is included in the returned list
|
|
826
|
+
- 'classSyncMethod' is not included in the returned list
|
|
827
|
+
- '_classMethodProtected' is not included in the returned list
|
|
592
828
|
"""
|
|
593
829
|
reflect = ReflectionInstance(FakeClass())
|
|
594
830
|
private_class_methods = reflect.getPrivateClassSyncMethods()
|
|
@@ -598,12 +834,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
598
834
|
|
|
599
835
|
async def testGetPrivateClassAsyncMethods(self):
|
|
600
836
|
"""
|
|
601
|
-
Test
|
|
837
|
+
Test ReflectionInstance.getPrivateClassAsyncMethods() method functionality.
|
|
602
838
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
839
|
+
Verifies that the getPrivateClassAsyncMethods method correctly identifies and
|
|
840
|
+
returns only private asynchronous class methods (prefixed with double underscores)
|
|
841
|
+
from the wrapped instance, excluding public and protected async class methods.
|
|
842
|
+
|
|
843
|
+
Assertions
|
|
844
|
+
----------
|
|
845
|
+
- '__classAsyncMethodPrivate' is included in the returned list
|
|
846
|
+
- 'classAsyncMethod' is not included in the returned list
|
|
847
|
+
- '_classAsyncMethodProtected' is not included in the returned list
|
|
607
848
|
"""
|
|
608
849
|
reflect = ReflectionInstance(FakeClass())
|
|
609
850
|
private_class_async_methods = reflect.getPrivateClassAsyncMethods()
|
|
@@ -613,13 +854,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
613
854
|
|
|
614
855
|
async def testGetPublicStaticMethods(self):
|
|
615
856
|
"""
|
|
616
|
-
|
|
617
|
-
|
|
857
|
+
Test ReflectionInstance.getPublicStaticMethods() method functionality.
|
|
858
|
+
|
|
859
|
+
Verifies that the getPublicStaticMethods method correctly identifies and
|
|
860
|
+
returns the names of public static methods from the wrapped instance,
|
|
861
|
+
excluding protected and private static methods.
|
|
618
862
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
863
|
+
Assertions
|
|
864
|
+
----------
|
|
865
|
+
- 'staticMethod' is included in the returned list
|
|
866
|
+
- 'staticAsyncMethod' is included in the returned list
|
|
867
|
+
- 'static_async_method' is not included in the returned list
|
|
623
868
|
"""
|
|
624
869
|
reflect = ReflectionInstance(FakeClass())
|
|
625
870
|
public_static_methods = reflect.getPublicStaticMethods()
|
|
@@ -629,11 +874,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
629
874
|
|
|
630
875
|
async def testGetPublicStaticSyncMethods(self):
|
|
631
876
|
"""
|
|
632
|
-
Test
|
|
877
|
+
Test ReflectionInstance.getPublicStaticSyncMethods() method functionality.
|
|
878
|
+
|
|
879
|
+
Verifies that the getPublicStaticSyncMethods method correctly identifies and
|
|
880
|
+
returns only public static synchronous methods from the wrapped instance,
|
|
881
|
+
excluding async and non-public static methods.
|
|
633
882
|
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
- '
|
|
883
|
+
Assertions
|
|
884
|
+
----------
|
|
885
|
+
- 'staticMethod' is included in the returned list
|
|
886
|
+
- 'staticAsyncMethod' is not included in the returned list
|
|
887
|
+
- 'static_async_method' is not included in the returned list
|
|
637
888
|
"""
|
|
638
889
|
reflect = ReflectionInstance(FakeClass())
|
|
639
890
|
public_static_sync_methods = reflect.getPublicStaticSyncMethods()
|
|
@@ -643,11 +894,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
643
894
|
|
|
644
895
|
async def testGetPublicStaticAsyncMethods(self):
|
|
645
896
|
"""
|
|
646
|
-
Test
|
|
897
|
+
Test ReflectionInstance.getPublicStaticAsyncMethods() method functionality.
|
|
647
898
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
899
|
+
Verifies that the getPublicStaticAsyncMethods method correctly identifies and
|
|
900
|
+
returns only public static asynchronous methods from the wrapped instance,
|
|
901
|
+
excluding sync and non-public static methods.
|
|
902
|
+
|
|
903
|
+
Assertions
|
|
904
|
+
----------
|
|
905
|
+
- 'staticAsyncMethod' is included in the returned list
|
|
906
|
+
- 'staticMethod' is not included in the returned list
|
|
907
|
+
- 'static_async_method' is not included in the returned list
|
|
651
908
|
"""
|
|
652
909
|
reflect = ReflectionInstance(FakeClass())
|
|
653
910
|
public_static_async_methods = reflect.getPublicStaticAsyncMethods()
|
|
@@ -657,12 +914,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
657
914
|
|
|
658
915
|
async def testGetProtectedStaticMethods(self):
|
|
659
916
|
"""
|
|
660
|
-
Test
|
|
917
|
+
Test ReflectionInstance.getProtectedStaticMethods() method functionality.
|
|
918
|
+
|
|
919
|
+
Verifies that the getProtectedStaticMethods method correctly identifies and
|
|
920
|
+
returns only protected static methods (prefixed with single underscore) from
|
|
921
|
+
the wrapped instance, excluding public and private static methods.
|
|
661
922
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
-
|
|
665
|
-
-
|
|
923
|
+
Assertions
|
|
924
|
+
----------
|
|
925
|
+
- '_staticMethodProtected' is included in the returned list
|
|
926
|
+
- 'staticMethod' is not included in the returned list
|
|
927
|
+
- '__staticMethodPrivate' is not included in the returned list
|
|
666
928
|
"""
|
|
667
929
|
reflect = ReflectionInstance(FakeClass())
|
|
668
930
|
protected_static_methods = reflect.getProtectedStaticMethods()
|
|
@@ -672,12 +934,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
672
934
|
|
|
673
935
|
async def testGetProtectedStaticSyncMethods(self):
|
|
674
936
|
"""
|
|
675
|
-
Test
|
|
676
|
-
protected static synchronous methods of the FakeClass.
|
|
937
|
+
Test ReflectionInstance.getProtectedStaticSyncMethods() method functionality.
|
|
677
938
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
939
|
+
Verifies that the getProtectedStaticSyncMethods method correctly identifies and
|
|
940
|
+
returns only protected static synchronous methods (prefixed with single underscore)
|
|
941
|
+
from the wrapped instance, excluding async and non-protected static methods.
|
|
942
|
+
|
|
943
|
+
Assertions
|
|
944
|
+
----------
|
|
945
|
+
- '_staticMethodProtected' is included in the returned list
|
|
946
|
+
- 'staticAsyncMethod' is not included in the returned list
|
|
947
|
+
- '__staticMethodPrivate' is not included in the returned list
|
|
681
948
|
"""
|
|
682
949
|
reflect = ReflectionInstance(FakeClass())
|
|
683
950
|
protected_static_sync_methods = reflect.getProtectedStaticSyncMethods()
|
|
@@ -687,12 +954,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
687
954
|
|
|
688
955
|
async def testGetProtectedStaticAsyncMethods(self):
|
|
689
956
|
"""
|
|
690
|
-
Test
|
|
957
|
+
Test ReflectionInstance.getProtectedStaticAsyncMethods() method functionality.
|
|
958
|
+
|
|
959
|
+
Verifies that the getProtectedStaticAsyncMethods method correctly identifies and
|
|
960
|
+
returns only protected static asynchronous methods (prefixed with single underscore)
|
|
961
|
+
from the wrapped instance, excluding public and private static methods.
|
|
691
962
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
-
|
|
695
|
-
-
|
|
963
|
+
Assertions
|
|
964
|
+
----------
|
|
965
|
+
- '_staticAsyncMethodProtected' is included in the returned list
|
|
966
|
+
- 'staticMethod' is not included in the returned list
|
|
967
|
+
- '__staticMethodPrivate' is not included in the returned list
|
|
696
968
|
"""
|
|
697
969
|
reflect = ReflectionInstance(FakeClass())
|
|
698
970
|
protected_static_async_methods = reflect.getProtectedStaticAsyncMethods()
|
|
@@ -702,9 +974,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
702
974
|
|
|
703
975
|
async def testGetPrivateStaticMethods(self):
|
|
704
976
|
"""
|
|
705
|
-
Test
|
|
706
|
-
|
|
707
|
-
|
|
977
|
+
Test ReflectionInstance.getPrivateStaticMethods() method functionality.
|
|
978
|
+
|
|
979
|
+
Verifies that the getPrivateStaticMethods method correctly identifies and
|
|
980
|
+
returns only private static methods (prefixed with double underscores) from
|
|
981
|
+
the wrapped instance, excluding protected and public static methods.
|
|
982
|
+
|
|
983
|
+
Assertions
|
|
984
|
+
----------
|
|
985
|
+
- '__staticMethodPrivate' is included in the returned list
|
|
986
|
+
- 'staticMethod' is not included in the returned list
|
|
987
|
+
- '_staticMethodProtected' is not included in the returned list
|
|
708
988
|
"""
|
|
709
989
|
reflect = ReflectionInstance(FakeClass())
|
|
710
990
|
private_static_methods = reflect.getPrivateStaticMethods()
|
|
@@ -714,11 +994,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
714
994
|
|
|
715
995
|
async def testGetPrivateStaticSyncMethods(self):
|
|
716
996
|
"""
|
|
717
|
-
Test
|
|
997
|
+
Test ReflectionInstance.getPrivateStaticSyncMethods() method functionality.
|
|
998
|
+
|
|
999
|
+
Verifies that the getPrivateStaticSyncMethods method correctly identifies and
|
|
1000
|
+
returns only private static synchronous methods (prefixed with double underscores)
|
|
1001
|
+
from the wrapped instance, excluding public and protected static methods.
|
|
718
1002
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
-
|
|
1003
|
+
Assertions
|
|
1004
|
+
----------
|
|
1005
|
+
- '__staticMethodPrivate' is included in the returned list
|
|
1006
|
+
- 'staticMethod' is not included in the returned list
|
|
1007
|
+
- '_staticMethodProtected' is not included in the returned list
|
|
722
1008
|
"""
|
|
723
1009
|
reflect = ReflectionInstance(FakeClass())
|
|
724
1010
|
private_static_sync_methods = reflect.getPrivateStaticSyncMethods()
|
|
@@ -728,11 +1014,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
728
1014
|
|
|
729
1015
|
async def testGetPrivateStaticAsyncMethods(self):
|
|
730
1016
|
"""
|
|
731
|
-
Test
|
|
1017
|
+
Test ReflectionInstance.getPrivateStaticAsyncMethods() method functionality.
|
|
1018
|
+
|
|
1019
|
+
Verifies that the getPrivateStaticAsyncMethods method correctly identifies and
|
|
1020
|
+
returns only private static asynchronous methods (prefixed with double underscores)
|
|
1021
|
+
from the wrapped instance, excluding public and protected static async methods.
|
|
732
1022
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
-
|
|
1023
|
+
Assertions
|
|
1024
|
+
----------
|
|
1025
|
+
- '__staticAsyncMethodPrivate' is included in the returned list
|
|
1026
|
+
- 'staticAsyncMethod' is not included in the returned list
|
|
1027
|
+
- '_staticAsyncMethodProtected' is not included in the returned list
|
|
736
1028
|
"""
|
|
737
1029
|
reflect = ReflectionInstance(FakeClass())
|
|
738
1030
|
private_static_async_methods = reflect.getPrivateStaticAsyncMethods()
|
|
@@ -742,8 +1034,16 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
742
1034
|
|
|
743
1035
|
async def testGetDunderMethods(self):
|
|
744
1036
|
"""
|
|
745
|
-
Test
|
|
746
|
-
|
|
1037
|
+
Test ReflectionInstance.getDunderMethods() method functionality.
|
|
1038
|
+
|
|
1039
|
+
Verifies that the getDunderMethods method correctly identifies and returns
|
|
1040
|
+
dunder (double underscore) methods from the wrapped instance. Tests the
|
|
1041
|
+
detection of special Python methods with double underscore prefix and suffix.
|
|
1042
|
+
|
|
1043
|
+
Assertions
|
|
1044
|
+
----------
|
|
1045
|
+
- '__init__' is present in the returned list
|
|
1046
|
+
- '__class__' is present in the returned list
|
|
747
1047
|
"""
|
|
748
1048
|
reflect = ReflectionInstance(FakeClass())
|
|
749
1049
|
dunder_methods = reflect.getDunderMethods()
|
|
@@ -752,11 +1052,16 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
752
1052
|
|
|
753
1053
|
async def testGetMagicMethods(self):
|
|
754
1054
|
"""
|
|
755
|
-
|
|
756
|
-
|
|
1055
|
+
Test ReflectionInstance.getMagicMethods() method functionality.
|
|
1056
|
+
|
|
1057
|
+
Verifies that the getMagicMethods method correctly identifies and returns
|
|
1058
|
+
magic methods (special Python methods with double underscores) from the
|
|
1059
|
+
wrapped instance. Tests the detection of commonly expected magic methods.
|
|
757
1060
|
|
|
758
|
-
|
|
759
|
-
|
|
1061
|
+
Assertions
|
|
1062
|
+
----------
|
|
1063
|
+
- '__init__' is present in the returned list
|
|
1064
|
+
- '__class__' is present in the returned list
|
|
760
1065
|
"""
|
|
761
1066
|
reflect = ReflectionInstance(FakeClass())
|
|
762
1067
|
magic_methods = reflect.getMagicMethods()
|
|
@@ -765,8 +1070,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
765
1070
|
|
|
766
1071
|
async def testGetProperties(self):
|
|
767
1072
|
"""
|
|
768
|
-
Test
|
|
769
|
-
|
|
1073
|
+
Test ReflectionInstance.getProperties() method functionality.
|
|
1074
|
+
|
|
1075
|
+
Verifies that the getProperties method correctly identifies and returns all
|
|
1076
|
+
properties (computed properties) from the wrapped instance, including public,
|
|
1077
|
+
protected, and private properties.
|
|
1078
|
+
|
|
1079
|
+
Assertions
|
|
1080
|
+
----------
|
|
1081
|
+
- 'computed_public_property' is present in the returned list
|
|
1082
|
+
- '_computed_property_protected' is present in the returned list
|
|
1083
|
+
- '__computed_property_private' is present in the returned list
|
|
770
1084
|
"""
|
|
771
1085
|
reflect = ReflectionInstance(FakeClass())
|
|
772
1086
|
properties = reflect.getProperties()
|
|
@@ -776,13 +1090,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
776
1090
|
|
|
777
1091
|
async def testGetPublicProperties(self):
|
|
778
1092
|
"""
|
|
779
|
-
|
|
780
|
-
and returns only the public properties of a given class instance.
|
|
1093
|
+
Test ReflectionInstance.getPublicProperties() method functionality.
|
|
781
1094
|
|
|
782
|
-
Verifies that
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
1095
|
+
Verifies that the getPublicProperties method correctly identifies and returns
|
|
1096
|
+
only public properties from the wrapped instance, excluding protected and
|
|
1097
|
+
private properties based on Python naming conventions.
|
|
1098
|
+
|
|
1099
|
+
Assertions
|
|
1100
|
+
----------
|
|
1101
|
+
- 'computed_public_property' is included in the returned list
|
|
1102
|
+
- '_computed_property_protected' is not included in the returned list
|
|
1103
|
+
- '__computed_property_private' is not included in the returned list
|
|
786
1104
|
"""
|
|
787
1105
|
reflect = ReflectionInstance(FakeClass())
|
|
788
1106
|
public_properties = reflect.getPublicProperties()
|
|
@@ -792,12 +1110,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
792
1110
|
|
|
793
1111
|
async def testGetProtectedProperties(self):
|
|
794
1112
|
"""
|
|
795
|
-
Test
|
|
1113
|
+
Test ReflectionInstance.getProtectedProperties() method functionality.
|
|
1114
|
+
|
|
1115
|
+
Verifies that the getProtectedProperties method correctly identifies and returns
|
|
1116
|
+
only protected properties (prefixed with single underscore) from the wrapped
|
|
1117
|
+
instance, excluding public and private properties.
|
|
796
1118
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
-
|
|
800
|
-
-
|
|
1119
|
+
Assertions
|
|
1120
|
+
----------
|
|
1121
|
+
- '_computed_property_protected' is included in the returned list
|
|
1122
|
+
- 'computed_public_property' is not included in the returned list
|
|
1123
|
+
- '__computed_property_private' is not included in the returned list
|
|
801
1124
|
"""
|
|
802
1125
|
reflect = ReflectionInstance(FakeClass())
|
|
803
1126
|
protected_properties = reflect.getProtectedProperties()
|
|
@@ -807,11 +1130,17 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
807
1130
|
|
|
808
1131
|
async def testGetPrivateProperties(self):
|
|
809
1132
|
"""
|
|
810
|
-
Test
|
|
1133
|
+
Test ReflectionInstance.getPrivateProperties() method functionality.
|
|
1134
|
+
|
|
1135
|
+
Verifies that the getPrivateProperties method correctly identifies and returns
|
|
1136
|
+
only private properties (prefixed with double underscores) from the wrapped
|
|
1137
|
+
instance, excluding public and protected properties.
|
|
811
1138
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
-
|
|
1139
|
+
Assertions
|
|
1140
|
+
----------
|
|
1141
|
+
- '__computed_property_private' is included in the returned list
|
|
1142
|
+
- 'computed_public_property' is not included in the returned list
|
|
1143
|
+
- '_computed_property_protected' is not included in the returned list
|
|
815
1144
|
"""
|
|
816
1145
|
reflect = ReflectionInstance(FakeClass())
|
|
817
1146
|
private_properties = reflect.getPrivateProperties()
|
|
@@ -821,11 +1150,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
821
1150
|
|
|
822
1151
|
async def testGetProperty(self):
|
|
823
1152
|
"""
|
|
824
|
-
|
|
825
|
-
from an instance of FakeClass.
|
|
1153
|
+
Test ReflectionInstance.getProperty() method functionality.
|
|
826
1154
|
|
|
827
|
-
|
|
828
|
-
from
|
|
1155
|
+
Verifies that the getProperty method correctly retrieves the value of a
|
|
1156
|
+
computed property from the wrapped instance. Tests property value access
|
|
1157
|
+
through reflection and compares with direct property access.
|
|
1158
|
+
|
|
1159
|
+
Assertions
|
|
1160
|
+
----------
|
|
1161
|
+
- Property value retrieved through reflection equals direct property access value
|
|
829
1162
|
"""
|
|
830
1163
|
reflect = ReflectionInstance(FakeClass())
|
|
831
1164
|
value = reflect.getProperty('computed_public_property')
|
|
@@ -833,9 +1166,15 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
833
1166
|
|
|
834
1167
|
async def testGetPropertySignature(self):
|
|
835
1168
|
"""
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
1169
|
+
Test ReflectionInstance.getPropertySignature() method functionality.
|
|
1170
|
+
|
|
1171
|
+
Verifies that the getPropertySignature method correctly retrieves the
|
|
1172
|
+
signature of a specified property from the wrapped instance. Tests
|
|
1173
|
+
property signature inspection and string representation.
|
|
1174
|
+
|
|
1175
|
+
Assertions
|
|
1176
|
+
----------
|
|
1177
|
+
- Signature of 'computed_public_property' equals '(self) -> str'
|
|
839
1178
|
"""
|
|
840
1179
|
reflect = ReflectionInstance(FakeClass())
|
|
841
1180
|
signature = reflect.getPropertySignature('computed_public_property')
|
|
@@ -843,20 +1182,31 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
843
1182
|
|
|
844
1183
|
async def testGetPropertyDocstring(self):
|
|
845
1184
|
"""
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
1185
|
+
Test ReflectionInstance.getPropertyDocstring() method functionality.
|
|
1186
|
+
|
|
1187
|
+
Verifies that the getPropertyDocstring method correctly retrieves the
|
|
1188
|
+
docstring for a specified property from the wrapped instance. Tests
|
|
1189
|
+
property documentation extraction.
|
|
1190
|
+
|
|
1191
|
+
Assertions
|
|
1192
|
+
----------
|
|
1193
|
+
- Docstring for 'computed_public_property' contains 'Returns a string indicating this is a public'
|
|
849
1194
|
"""
|
|
850
1195
|
reflect = ReflectionInstance(FakeClass())
|
|
851
1196
|
docstring = reflect.getPropertyDocstring('computed_public_property')
|
|
852
|
-
self.assertIn('Returns
|
|
1197
|
+
self.assertIn('Returns a string indicating this is a public', docstring)
|
|
853
1198
|
|
|
854
1199
|
async def testGetConstructorDependencies(self):
|
|
855
1200
|
"""
|
|
856
|
-
|
|
1201
|
+
Test ReflectionInstance.getConstructorDependencies() method functionality.
|
|
857
1202
|
|
|
858
|
-
|
|
859
|
-
|
|
1203
|
+
Verifies that the getConstructorDependencies method returns an instance
|
|
1204
|
+
of ClassDependency containing the constructor dependencies of the wrapped
|
|
1205
|
+
instance's class. Tests dependency analysis for class constructors.
|
|
1206
|
+
|
|
1207
|
+
Assertions
|
|
1208
|
+
----------
|
|
1209
|
+
- Returned value is an instance of ClassDependency
|
|
860
1210
|
"""
|
|
861
1211
|
reflect = ReflectionInstance(FakeClass())
|
|
862
1212
|
dependencies = reflect.getConstructorDependencies()
|
|
@@ -864,14 +1214,18 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
864
1214
|
|
|
865
1215
|
async def testGetMethodDependencies(self):
|
|
866
1216
|
"""
|
|
867
|
-
Test
|
|
868
|
-
|
|
1217
|
+
Test ReflectionInstance.getMethodDependencies() method functionality.
|
|
1218
|
+
|
|
1219
|
+
Verifies that the getMethodDependencies method correctly resolves the
|
|
1220
|
+
dependencies of a specified method from the wrapped instance. Tests
|
|
1221
|
+
method parameter type analysis and dependency resolution.
|
|
869
1222
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
1223
|
+
Assertions
|
|
1224
|
+
----------
|
|
1225
|
+
- 'x' parameter is present in resolved dependencies
|
|
1226
|
+
- 'y' parameter is present in resolved dependencies
|
|
1227
|
+
- Both parameters are identified as int type with correct metadata
|
|
1228
|
+
- No unresolved dependencies exist
|
|
875
1229
|
"""
|
|
876
1230
|
reflect = ReflectionInstance(FakeClass())
|
|
877
1231
|
method_deps = reflect.getMethodDependencies('instanceSyncMethod')
|