orionis 0.438.0__py3-none-any.whl → 0.440.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.438.0.dist-info → orionis-0.440.0.dist-info}/METADATA +1 -1
- {orionis-0.438.0.dist-info → orionis-0.440.0.dist-info}/RECORD +23 -23
- tests/container/context/test_manager.py +1 -0
- tests/container/context/test_scope.py +1 -0
- tests/container/core/test_container.py +45 -1
- tests/container/core/test_singleton.py +5 -0
- tests/container/core/test_thread_safety.py +2 -0
- tests/container/validators/test_is_not_subclass.py +0 -1
- tests/foundation/config/queue/test_foundation_config_queue_brokers.py +1 -0
- tests/foundation/config/startup/test_foundation_config_startup.py +0 -1
- tests/services/environment/test_services_environment.py +5 -4
- tests/services/introspection/reflection/mock/fake_reflect_instance.py +750 -267
- tests/services/introspection/reflection/test_reflection_abstract.py +167 -92
- 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.438.0.dist-info → orionis-0.440.0.dist-info}/WHEEL +0 -0
- {orionis-0.438.0.dist-info → orionis-0.440.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.438.0.dist-info → orionis-0.440.0.dist-info}/top_level.txt +0 -0
- {orionis-0.438.0.dist-info → orionis-0.440.0.dist-info}/zip-safe +0 -0
|
@@ -7,11 +7,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
7
7
|
|
|
8
8
|
async def testGetInstance(self):
|
|
9
9
|
"""
|
|
10
|
-
|
|
11
|
-
using the getInstance method.
|
|
10
|
+
Test that ReflectionConcrete creates an instance of FakeClass using getInstance.
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
Returns
|
|
13
|
+
-------
|
|
14
|
+
None
|
|
15
|
+
This method asserts that the returned instance is of type FakeClass.
|
|
15
16
|
"""
|
|
16
17
|
reflect = ReflectionConcrete(FakeClass)
|
|
17
18
|
instance = reflect.getInstance()
|
|
@@ -19,10 +20,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
19
20
|
|
|
20
21
|
async def testGetClass(self):
|
|
21
22
|
"""
|
|
22
|
-
|
|
23
|
+
Test that ReflectionConcrete.getClass returns the correct class object.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
Returns
|
|
26
|
+
-------
|
|
27
|
+
None
|
|
28
|
+
Asserts that the returned class is FakeClass.
|
|
26
29
|
"""
|
|
27
30
|
reflect = ReflectionConcrete(FakeClass)
|
|
28
31
|
cls = reflect.getClass()
|
|
@@ -30,11 +33,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
30
33
|
|
|
31
34
|
async def testGetClassName(self):
|
|
32
35
|
"""
|
|
33
|
-
|
|
36
|
+
Test that ReflectionConcrete retrieves the correct class name.
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
Returns
|
|
39
|
+
-------
|
|
40
|
+
None
|
|
41
|
+
Asserts that the returned class name matches 'FakeClass'.
|
|
38
42
|
"""
|
|
39
43
|
reflect = ReflectionConcrete(FakeClass)
|
|
40
44
|
class_name = reflect.getClassName()
|
|
@@ -42,9 +46,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
42
46
|
|
|
43
47
|
async def testGetModuleName(self):
|
|
44
48
|
"""
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
Test that ReflectionConcrete.getModuleName returns the correct module name for FakeClass.
|
|
50
|
+
|
|
51
|
+
Returns
|
|
52
|
+
-------
|
|
53
|
+
None
|
|
54
|
+
Asserts that the returned module name matches the expected string.
|
|
48
55
|
"""
|
|
49
56
|
reflect = ReflectionConcrete(FakeClass)
|
|
50
57
|
module_name = reflect.getModuleName()
|
|
@@ -52,12 +59,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
52
59
|
|
|
53
60
|
async def testGetModuleWithClassName(self):
|
|
54
61
|
"""
|
|
55
|
-
|
|
56
|
-
returns the fully qualified module and class name for the given `FakeClass`.
|
|
62
|
+
Test that ReflectionConcrete.getModuleWithClassName returns the fully qualified module and class name.
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
Returns
|
|
65
|
+
-------
|
|
66
|
+
None
|
|
67
|
+
Asserts that the returned string matches the expected module path and class name.
|
|
61
68
|
"""
|
|
62
69
|
reflect = ReflectionConcrete(FakeClass)
|
|
63
70
|
module_with_class_name = reflect.getModuleWithClassName()
|
|
@@ -65,8 +72,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
65
72
|
|
|
66
73
|
async def testGetDocstring(self):
|
|
67
74
|
"""
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
Test that ReflectionConcrete.getDocstring returns the correct docstring for FakeClass.
|
|
76
|
+
|
|
77
|
+
Returns
|
|
78
|
+
-------
|
|
79
|
+
None
|
|
80
|
+
Asserts that the returned docstring matches FakeClass.__doc__.
|
|
70
81
|
"""
|
|
71
82
|
reflect = ReflectionConcrete(FakeClass)
|
|
72
83
|
docstring = reflect.getDocstring()
|
|
@@ -74,10 +85,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
74
85
|
|
|
75
86
|
async def testGetBaseClasses(self):
|
|
76
87
|
"""
|
|
77
|
-
|
|
88
|
+
Test that ReflectionConcrete.getBaseClasses returns the base classes of FakeClass.
|
|
78
89
|
|
|
79
|
-
|
|
80
|
-
|
|
90
|
+
Returns
|
|
91
|
+
-------
|
|
92
|
+
None
|
|
93
|
+
Asserts that the direct base class of FakeClass is included in the returned list.
|
|
81
94
|
"""
|
|
82
95
|
reflect = ReflectionConcrete(FakeClass)
|
|
83
96
|
base_classes = reflect.getBaseClasses()
|
|
@@ -85,11 +98,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
85
98
|
|
|
86
99
|
async def testGetSourceCode(self):
|
|
87
100
|
"""
|
|
88
|
-
|
|
89
|
-
correctly retrieves the source code of the `FakeClass` class.
|
|
101
|
+
Test that ReflectionConcrete.getSourceCode retrieves the source code of FakeClass.
|
|
90
102
|
|
|
91
|
-
|
|
92
|
-
|
|
103
|
+
Returns
|
|
104
|
+
-------
|
|
105
|
+
None
|
|
106
|
+
Asserts that the returned source code starts with the expected class definition line.
|
|
93
107
|
"""
|
|
94
108
|
reflect = ReflectionConcrete(FakeClass)
|
|
95
109
|
source_code = reflect.getSourceCode()
|
|
@@ -97,8 +111,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
97
111
|
|
|
98
112
|
async def testGetFile(self):
|
|
99
113
|
"""
|
|
100
|
-
|
|
101
|
-
|
|
114
|
+
Test that ReflectionConcrete.getFile returns the correct file path for FakeClass.
|
|
115
|
+
|
|
116
|
+
Returns
|
|
117
|
+
-------
|
|
118
|
+
None
|
|
119
|
+
Asserts that the returned file path ends with 'fake_reflect_instance.py'.
|
|
102
120
|
"""
|
|
103
121
|
reflect = ReflectionConcrete(FakeClass)
|
|
104
122
|
file_path = reflect.getFile()
|
|
@@ -106,9 +124,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
106
124
|
|
|
107
125
|
async def testGetAnnotations(self):
|
|
108
126
|
"""
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
127
|
+
Test that ReflectionConcrete.getAnnotations retrieves the annotations of FakeClass.
|
|
128
|
+
|
|
129
|
+
Returns
|
|
130
|
+
-------
|
|
131
|
+
None
|
|
132
|
+
Asserts that 'public_attr' is present in the returned annotations.
|
|
112
133
|
"""
|
|
113
134
|
reflect = ReflectionConcrete(FakeClass)
|
|
114
135
|
annotations = reflect.getAnnotations()
|
|
@@ -116,11 +137,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
116
137
|
|
|
117
138
|
async def testHasAttribute(self):
|
|
118
139
|
"""
|
|
119
|
-
Test whether
|
|
140
|
+
Test whether ReflectionConcrete correctly identifies the presence or absence of attributes.
|
|
120
141
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
142
|
+
Returns
|
|
143
|
+
-------
|
|
144
|
+
None
|
|
145
|
+
Asserts that hasAttribute returns True for an existing attribute and False for a non-existent attribute.
|
|
124
146
|
"""
|
|
125
147
|
reflect = ReflectionConcrete(FakeClass)
|
|
126
148
|
self.assertTrue(reflect.hasAttribute('public_attr'))
|
|
@@ -128,11 +150,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
128
150
|
|
|
129
151
|
async def testGetAttribute(self):
|
|
130
152
|
"""
|
|
131
|
-
|
|
153
|
+
Test ReflectionConcrete.getAttribute for retrieving attribute values.
|
|
132
154
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
155
|
+
Returns
|
|
156
|
+
-------
|
|
157
|
+
None
|
|
158
|
+
Asserts correct value for an existing attribute and None for a non-existent attribute.
|
|
136
159
|
"""
|
|
137
160
|
reflect = ReflectionConcrete(FakeClass)
|
|
138
161
|
self.assertEqual(reflect.getAttribute('public_attr'), 42)
|
|
@@ -140,13 +163,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
140
163
|
|
|
141
164
|
async def testSetAttribute(self):
|
|
142
165
|
"""
|
|
143
|
-
Test
|
|
166
|
+
Test ReflectionConcrete.setAttribute and getAttribute for setting and retrieving attributes.
|
|
144
167
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
- Setting and getting a private attribute ('__python').
|
|
168
|
+
Returns
|
|
169
|
+
-------
|
|
170
|
+
None
|
|
171
|
+
Asserts that public, protected, and private attributes can be set and retrieved correctly.
|
|
150
172
|
"""
|
|
151
173
|
reflect = ReflectionConcrete(FakeClass)
|
|
152
174
|
self.assertTrue(reflect.setAttribute('name', 'Orionis Framework'))
|
|
@@ -158,12 +180,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
158
180
|
|
|
159
181
|
async def testRemoveAttribute(self):
|
|
160
182
|
"""
|
|
161
|
-
|
|
183
|
+
Test the removal of an attribute from a reflected class instance.
|
|
162
184
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
185
|
+
Returns
|
|
186
|
+
-------
|
|
187
|
+
None
|
|
188
|
+
Asserts that an attribute can be set, removed, and is no longer present after removal.
|
|
167
189
|
"""
|
|
168
190
|
reflect = ReflectionConcrete(FakeClass)
|
|
169
191
|
reflect.setAttribute('new_attr', 100)
|
|
@@ -172,13 +194,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
172
194
|
|
|
173
195
|
async def testGetAttributes(self):
|
|
174
196
|
"""
|
|
175
|
-
|
|
176
|
-
from the FakeClass, including public, protected, and private attributes.
|
|
197
|
+
Test that ReflectionConcrete.getAttributes retrieves all attribute names from FakeClass.
|
|
177
198
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
199
|
+
Returns
|
|
200
|
+
-------
|
|
201
|
+
None
|
|
202
|
+
Asserts that public, protected, and private attributes are present in the returned list.
|
|
182
203
|
"""
|
|
183
204
|
reflect = ReflectionConcrete(FakeClass)
|
|
184
205
|
attributes = reflect.getAttributes()
|
|
@@ -188,11 +209,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
188
209
|
|
|
189
210
|
async def testGetPublicAttributes(self):
|
|
190
211
|
"""
|
|
191
|
-
Test that
|
|
212
|
+
Test that ReflectionConcrete.getPublicAttributes retrieves only public attributes.
|
|
192
213
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
214
|
+
Returns
|
|
215
|
+
-------
|
|
216
|
+
None
|
|
217
|
+
Asserts that only public attributes are included in the result.
|
|
196
218
|
"""
|
|
197
219
|
reflect = ReflectionConcrete(FakeClass)
|
|
198
220
|
public_attributes = reflect.getPublicAttributes()
|
|
@@ -202,12 +224,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
202
224
|
|
|
203
225
|
async def testGetProtectedAttributes(self):
|
|
204
226
|
"""
|
|
205
|
-
Test that
|
|
227
|
+
Test that ReflectionConcrete.getProtectedAttributes identifies protected attributes.
|
|
206
228
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
229
|
+
Returns
|
|
230
|
+
-------
|
|
231
|
+
None
|
|
232
|
+
Asserts that only protected attributes are included in the result.
|
|
211
233
|
"""
|
|
212
234
|
reflect = ReflectionConcrete(FakeClass)
|
|
213
235
|
protected_attributes = reflect.getProtectedAttributes()
|
|
@@ -217,9 +239,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
217
239
|
|
|
218
240
|
async def testGetPrivateAttributes(self):
|
|
219
241
|
"""
|
|
220
|
-
Test that
|
|
221
|
-
|
|
222
|
-
|
|
242
|
+
Test that ReflectionConcrete.getPrivateAttributes identifies private attributes.
|
|
243
|
+
|
|
244
|
+
Returns
|
|
245
|
+
-------
|
|
246
|
+
None
|
|
247
|
+
Asserts that only private attributes are included in the result.
|
|
223
248
|
"""
|
|
224
249
|
reflect = ReflectionConcrete(FakeClass)
|
|
225
250
|
private_attributes = reflect.getPrivateAttributes()
|
|
@@ -229,9 +254,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
229
254
|
|
|
230
255
|
async def testGetDunderAttributes(self):
|
|
231
256
|
"""
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
257
|
+
Test that ReflectionConcrete.getDunderAttributes retrieves dunder attributes.
|
|
258
|
+
|
|
259
|
+
Returns
|
|
260
|
+
-------
|
|
261
|
+
None
|
|
262
|
+
Asserts that '__dd__' is present in the returned list of dunder attributes.
|
|
235
263
|
"""
|
|
236
264
|
reflect = ReflectionConcrete(FakeClass)
|
|
237
265
|
dunder_attributes = reflect.getDunderAttributes()
|
|
@@ -239,10 +267,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
239
267
|
|
|
240
268
|
async def testGetMagicAttributes(self):
|
|
241
269
|
"""
|
|
242
|
-
|
|
243
|
-
correctly retrieves magic (dunder) attributes from the `FakeClass`.
|
|
270
|
+
Test that ReflectionConcrete.getMagicAttributes retrieves magic (dunder) attributes.
|
|
244
271
|
|
|
245
|
-
|
|
272
|
+
Returns
|
|
273
|
+
-------
|
|
274
|
+
None
|
|
275
|
+
Asserts that '__dd__' is present in the returned list of magic attributes.
|
|
246
276
|
"""
|
|
247
277
|
reflect = ReflectionConcrete(FakeClass)
|
|
248
278
|
magic_attributes = reflect.getMagicAttributes()
|
|
@@ -250,11 +280,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
250
280
|
|
|
251
281
|
async def testHasMethod(self):
|
|
252
282
|
"""
|
|
253
|
-
|
|
283
|
+
Test that ReflectionConcrete.hasMethod identifies the presence of methods.
|
|
254
284
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
285
|
+
Returns
|
|
286
|
+
-------
|
|
287
|
+
None
|
|
288
|
+
Asserts that an existing method is found and a non-existent method is not found.
|
|
258
289
|
"""
|
|
259
290
|
reflect = ReflectionConcrete(FakeClass)
|
|
260
291
|
self.assertTrue(reflect.hasMethod('instanceSyncMethod'))
|
|
@@ -262,8 +293,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
262
293
|
|
|
263
294
|
async def testCallMethod(self):
|
|
264
295
|
"""
|
|
265
|
-
|
|
266
|
-
|
|
296
|
+
Test that ReflectionConcrete.callMethod invokes a synchronous method with arguments.
|
|
297
|
+
|
|
298
|
+
Returns
|
|
299
|
+
-------
|
|
300
|
+
None
|
|
301
|
+
Asserts that the result of calling 'instanceSyncMethod' with arguments 2 and 3 is 5.
|
|
267
302
|
"""
|
|
268
303
|
reflect = ReflectionConcrete(FakeClass)
|
|
269
304
|
reflect.getInstance() # Ensure instance is created
|
|
@@ -272,11 +307,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
272
307
|
|
|
273
308
|
async def testCallAsyncMethod(self):
|
|
274
309
|
"""
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
310
|
+
Test that ReflectionConcrete can call an asynchronous instance method.
|
|
311
|
+
|
|
312
|
+
Returns
|
|
313
|
+
-------
|
|
314
|
+
None
|
|
315
|
+
Asserts that the result of calling 'instanceAsyncMethod' with arguments 2 and 3 is 5.
|
|
280
316
|
"""
|
|
281
317
|
reflect = ReflectionConcrete(FakeClass)
|
|
282
318
|
reflect.getInstance() # Ensure instance is created
|
|
@@ -285,14 +321,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
285
321
|
|
|
286
322
|
async def testSetMethod(self):
|
|
287
323
|
"""
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
- The synchronous method returns the correct sum.
|
|
295
|
-
- The asynchronous method returns the correct sum after awaiting.
|
|
324
|
+
Test that ReflectionConcrete can dynamically set and call synchronous and asynchronous methods.
|
|
325
|
+
|
|
326
|
+
Returns
|
|
327
|
+
-------
|
|
328
|
+
None
|
|
329
|
+
Asserts correct results for both sync and async dynamically set methods.
|
|
296
330
|
"""
|
|
297
331
|
def mockSyncMethod(cls:FakeClass, num1, num2):
|
|
298
332
|
return num1 + num2
|
|
@@ -314,12 +348,11 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
314
348
|
async def testRemoveMethod(self):
|
|
315
349
|
"""
|
|
316
350
|
Test the removal of a dynamically added private method from a reflected class instance.
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
- Asserts that the method no longer exists after removal.
|
|
351
|
+
|
|
352
|
+
Returns
|
|
353
|
+
-------
|
|
354
|
+
None
|
|
355
|
+
Asserts that the method exists after addition and is removed successfully.
|
|
323
356
|
"""
|
|
324
357
|
def _testProtectedMethod(cls:FakeClass, x, y):
|
|
325
358
|
return x + y
|
|
@@ -336,11 +369,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
336
369
|
|
|
337
370
|
async def testGetMethodSignature(self):
|
|
338
371
|
"""
|
|
339
|
-
|
|
340
|
-
the signature of the 'instanceSyncMethod' from the FakeClass.
|
|
372
|
+
Test that ReflectionConcrete.getMethodSignature retrieves the signature of a method.
|
|
341
373
|
|
|
342
|
-
|
|
343
|
-
|
|
374
|
+
Returns
|
|
375
|
+
-------
|
|
376
|
+
None
|
|
377
|
+
Asserts that the returned signature string matches the expected format.
|
|
344
378
|
"""
|
|
345
379
|
reflect = ReflectionConcrete(FakeClass)
|
|
346
380
|
signature = reflect.getMethodSignature('instanceSyncMethod')
|
|
@@ -348,8 +382,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
348
382
|
|
|
349
383
|
async def testGetMethods(self):
|
|
350
384
|
"""
|
|
351
|
-
Test that
|
|
352
|
-
|
|
385
|
+
Test that ReflectionConcrete.getMethods retrieves method names of FakeClass.
|
|
386
|
+
|
|
387
|
+
Returns
|
|
388
|
+
-------
|
|
389
|
+
None
|
|
390
|
+
Asserts that both synchronous and asynchronous instance methods are present.
|
|
353
391
|
"""
|
|
354
392
|
reflect = ReflectionConcrete(FakeClass)
|
|
355
393
|
methods = reflect.getMethods()
|
|
@@ -358,12 +396,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
358
396
|
|
|
359
397
|
async def testGetPublicMethods(self):
|
|
360
398
|
"""
|
|
361
|
-
Test that
|
|
399
|
+
Test that ReflectionConcrete.getPublicMethods returns only public methods.
|
|
362
400
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
401
|
+
Returns
|
|
402
|
+
-------
|
|
403
|
+
None
|
|
404
|
+
Asserts that public methods are included and protected/private methods are excluded.
|
|
367
405
|
"""
|
|
368
406
|
reflect = ReflectionConcrete(FakeClass)
|
|
369
407
|
public_methods = reflect.getPublicMethods()
|
|
@@ -373,12 +411,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
373
411
|
|
|
374
412
|
async def testGetPublicSyncMethods(self):
|
|
375
413
|
"""
|
|
376
|
-
Test that ReflectionConcrete.getPublicSyncMethods
|
|
414
|
+
Test that ReflectionConcrete.getPublicSyncMethods returns only public synchronous methods.
|
|
377
415
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
416
|
+
Returns
|
|
417
|
+
-------
|
|
418
|
+
None
|
|
419
|
+
Asserts that only public synchronous methods are included in the result.
|
|
382
420
|
"""
|
|
383
421
|
reflect = ReflectionConcrete(FakeClass)
|
|
384
422
|
public_sync_methods = reflect.getPublicSyncMethods()
|
|
@@ -388,8 +426,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
388
426
|
|
|
389
427
|
async def testGetPublicAsyncMethods(self):
|
|
390
428
|
"""
|
|
391
|
-
Test that ReflectionConcrete.getPublicAsyncMethods
|
|
392
|
-
|
|
429
|
+
Test that ReflectionConcrete.getPublicAsyncMethods identifies public asynchronous methods.
|
|
430
|
+
|
|
431
|
+
Returns
|
|
432
|
+
-------
|
|
433
|
+
None
|
|
434
|
+
Asserts that only public async methods are included in the result.
|
|
393
435
|
"""
|
|
394
436
|
reflect = ReflectionConcrete(FakeClass)
|
|
395
437
|
public_async_methods = reflect.getPublicAsyncMethods()
|
|
@@ -399,9 +441,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
399
441
|
|
|
400
442
|
async def testGetProtectedMethods(self):
|
|
401
443
|
"""
|
|
402
|
-
Test that
|
|
403
|
-
|
|
404
|
-
|
|
444
|
+
Test that ReflectionConcrete.getProtectedMethods identifies protected methods.
|
|
445
|
+
|
|
446
|
+
Returns
|
|
447
|
+
-------
|
|
448
|
+
None
|
|
449
|
+
Asserts that only protected methods are included in the result.
|
|
405
450
|
"""
|
|
406
451
|
reflect = ReflectionConcrete(FakeClass)
|
|
407
452
|
protected_methods = reflect.getProtectedMethods()
|
|
@@ -411,13 +456,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
411
456
|
|
|
412
457
|
async def testGetProtectedSyncMethods(self):
|
|
413
458
|
"""
|
|
414
|
-
Test that
|
|
415
|
-
protected synchronous methods in the FakeClass.
|
|
459
|
+
Test that ReflectionConcrete.getProtectedSyncMethods identifies protected synchronous methods.
|
|
416
460
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
461
|
+
Returns
|
|
462
|
+
-------
|
|
463
|
+
None
|
|
464
|
+
Asserts that only protected synchronous methods are included in the result.
|
|
421
465
|
"""
|
|
422
466
|
reflect = ReflectionConcrete(FakeClass)
|
|
423
467
|
protected_sync_methods = reflect.getProtectedSyncMethods()
|
|
@@ -427,10 +471,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
427
471
|
|
|
428
472
|
async def testGetProtectedAsyncMethods(self):
|
|
429
473
|
"""
|
|
430
|
-
|
|
474
|
+
Test that ReflectionConcrete.getProtectedAsyncMethods returns only protected async methods.
|
|
431
475
|
|
|
432
|
-
|
|
433
|
-
|
|
476
|
+
Returns
|
|
477
|
+
-------
|
|
478
|
+
None
|
|
479
|
+
Asserts that only protected async methods are included in the result.
|
|
434
480
|
"""
|
|
435
481
|
reflect = ReflectionConcrete(FakeClass)
|
|
436
482
|
protected_async_methods = reflect.getProtectedAsyncMethods()
|
|
@@ -440,10 +486,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
440
486
|
|
|
441
487
|
async def testGetPrivateMethods(self):
|
|
442
488
|
"""
|
|
443
|
-
|
|
489
|
+
Test that ReflectionConcrete.getPrivateMethods returns only private methods.
|
|
444
490
|
|
|
445
|
-
|
|
446
|
-
|
|
491
|
+
Returns
|
|
492
|
+
-------
|
|
493
|
+
None
|
|
494
|
+
Asserts that only private methods are included in the result.
|
|
447
495
|
"""
|
|
448
496
|
reflect = ReflectionConcrete(FakeClass)
|
|
449
497
|
private_methods = reflect.getPrivateMethods()
|
|
@@ -453,10 +501,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
453
501
|
|
|
454
502
|
async def testGetPrivateSyncMethods(self):
|
|
455
503
|
"""
|
|
456
|
-
|
|
504
|
+
Test that ReflectionConcrete.getPrivateSyncMethods returns only private sync methods.
|
|
457
505
|
|
|
458
|
-
|
|
459
|
-
|
|
506
|
+
Returns
|
|
507
|
+
-------
|
|
508
|
+
None
|
|
509
|
+
Asserts that only private sync methods are included in the result.
|
|
460
510
|
"""
|
|
461
511
|
reflect = ReflectionConcrete(FakeClass)
|
|
462
512
|
private_sync_methods = reflect.getPrivateSyncMethods()
|
|
@@ -466,10 +516,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
466
516
|
|
|
467
517
|
async def testGetPrivateAsyncMethods(self):
|
|
468
518
|
"""
|
|
469
|
-
|
|
519
|
+
Test that ReflectionConcrete.getPrivateAsyncMethods returns only private async methods.
|
|
470
520
|
|
|
471
|
-
|
|
472
|
-
|
|
521
|
+
Returns
|
|
522
|
+
-------
|
|
523
|
+
None
|
|
524
|
+
Asserts that only private async methods are included in the result.
|
|
473
525
|
"""
|
|
474
526
|
reflect = ReflectionConcrete(FakeClass)
|
|
475
527
|
private_async_methods = reflect.getPrivateAsyncMethods()
|
|
@@ -479,10 +531,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
479
531
|
|
|
480
532
|
async def testGetPublicClassMethods(self):
|
|
481
533
|
"""
|
|
482
|
-
|
|
534
|
+
Test that ReflectionConcrete.getPublicClassMethods returns only public class methods.
|
|
483
535
|
|
|
484
|
-
|
|
485
|
-
|
|
536
|
+
Returns
|
|
537
|
+
-------
|
|
538
|
+
None
|
|
539
|
+
Asserts that only public class methods are included in the result.
|
|
486
540
|
"""
|
|
487
541
|
reflect = ReflectionConcrete(FakeClass)
|
|
488
542
|
public_class_methods = reflect.getPublicClassMethods()
|
|
@@ -492,10 +546,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
492
546
|
|
|
493
547
|
async def testGetPublicClassSyncMethods(self):
|
|
494
548
|
"""
|
|
495
|
-
|
|
549
|
+
Test that ReflectionConcrete.getPublicClassSyncMethods returns only public class sync methods.
|
|
496
550
|
|
|
497
|
-
|
|
498
|
-
|
|
551
|
+
Returns
|
|
552
|
+
-------
|
|
553
|
+
None
|
|
554
|
+
Asserts that only public class sync methods are included in the result.
|
|
499
555
|
"""
|
|
500
556
|
reflect = ReflectionConcrete(FakeClass)
|
|
501
557
|
public_class_sync_methods = reflect.getPublicClassSyncMethods()
|
|
@@ -505,10 +561,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
505
561
|
|
|
506
562
|
async def testGetPublicClassAsyncMethods(self):
|
|
507
563
|
"""
|
|
508
|
-
|
|
564
|
+
Test that ReflectionConcrete.getPublicClassAsyncMethods returns only public class async methods.
|
|
509
565
|
|
|
510
|
-
|
|
511
|
-
|
|
566
|
+
Returns
|
|
567
|
+
-------
|
|
568
|
+
None
|
|
569
|
+
Asserts that only public class async methods are included in the result.
|
|
512
570
|
"""
|
|
513
571
|
reflect = ReflectionConcrete(FakeClass)
|
|
514
572
|
public_class_async_methods = reflect.getPublicClassAsyncMethods()
|
|
@@ -518,10 +576,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
518
576
|
|
|
519
577
|
async def testGetProtectedClassMethods(self):
|
|
520
578
|
"""
|
|
521
|
-
|
|
579
|
+
Test that ReflectionConcrete.getProtectedClassMethods returns only protected class methods.
|
|
522
580
|
|
|
523
|
-
|
|
524
|
-
|
|
581
|
+
Returns
|
|
582
|
+
-------
|
|
583
|
+
None
|
|
584
|
+
Asserts that only protected class methods are included in the result.
|
|
525
585
|
"""
|
|
526
586
|
reflect = ReflectionConcrete(FakeClass)
|
|
527
587
|
protected_class_methods = reflect.getProtectedClassMethods()
|
|
@@ -531,10 +591,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
531
591
|
|
|
532
592
|
async def testGetProtectedClassSyncMethods(self):
|
|
533
593
|
"""
|
|
534
|
-
|
|
594
|
+
Test that ReflectionConcrete.getProtectedClassSyncMethods returns only protected class sync methods.
|
|
535
595
|
|
|
536
|
-
|
|
537
|
-
|
|
596
|
+
Returns
|
|
597
|
+
-------
|
|
598
|
+
None
|
|
599
|
+
Asserts that only protected class sync methods are included in the result.
|
|
538
600
|
"""
|
|
539
601
|
reflect = ReflectionConcrete(FakeClass)
|
|
540
602
|
protected_class_sync_methods = reflect.getProtectedClassSyncMethods()
|
|
@@ -544,10 +606,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
544
606
|
|
|
545
607
|
async def testGetProtectedClassAsyncMethods(self):
|
|
546
608
|
"""
|
|
547
|
-
|
|
609
|
+
Test that ReflectionConcrete.getProtectedClassAsyncMethods returns only protected class async methods.
|
|
548
610
|
|
|
549
|
-
|
|
550
|
-
|
|
611
|
+
Returns
|
|
612
|
+
-------
|
|
613
|
+
None
|
|
614
|
+
Asserts that only protected class async methods are included in the result.
|
|
551
615
|
"""
|
|
552
616
|
reflect = ReflectionConcrete(FakeClass)
|
|
553
617
|
protected_class_async_methods = reflect.getProtectedClassAsyncMethods()
|
|
@@ -557,10 +621,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
557
621
|
|
|
558
622
|
async def testGetPrivateClassMethods(self):
|
|
559
623
|
"""
|
|
560
|
-
|
|
624
|
+
Test that ReflectionConcrete.getPrivateClassMethods returns only private class methods.
|
|
561
625
|
|
|
562
|
-
|
|
563
|
-
|
|
626
|
+
Returns
|
|
627
|
+
-------
|
|
628
|
+
None
|
|
629
|
+
Asserts that only private class methods are included in the result.
|
|
564
630
|
"""
|
|
565
631
|
reflect = ReflectionConcrete(FakeClass)
|
|
566
632
|
private_class_methods = reflect.getPrivateClassMethods()
|
|
@@ -570,10 +636,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
570
636
|
|
|
571
637
|
async def testGetPrivateClassSyncMethods(self):
|
|
572
638
|
"""
|
|
573
|
-
|
|
639
|
+
Test that ReflectionConcrete.getPrivateClassSyncMethods returns only private class sync methods.
|
|
574
640
|
|
|
575
|
-
|
|
576
|
-
|
|
641
|
+
Returns
|
|
642
|
+
-------
|
|
643
|
+
None
|
|
644
|
+
Asserts that only private class sync methods are included in the result.
|
|
577
645
|
"""
|
|
578
646
|
reflect = ReflectionConcrete(FakeClass)
|
|
579
647
|
private_class_methods = reflect.getPrivateClassSyncMethods()
|
|
@@ -583,10 +651,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
583
651
|
|
|
584
652
|
async def testGetPrivateClassAsyncMethods(self):
|
|
585
653
|
"""
|
|
586
|
-
|
|
654
|
+
Test that ReflectionConcrete.getPrivateClassAsyncMethods returns only private class async methods.
|
|
587
655
|
|
|
588
|
-
|
|
589
|
-
|
|
656
|
+
Returns
|
|
657
|
+
-------
|
|
658
|
+
None
|
|
659
|
+
Asserts that only private class async methods are included in the result.
|
|
590
660
|
"""
|
|
591
661
|
reflect = ReflectionConcrete(FakeClass)
|
|
592
662
|
private_class_async_methods = reflect.getPrivateClassAsyncMethods()
|
|
@@ -596,10 +666,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
596
666
|
|
|
597
667
|
async def testGetPublicStaticMethods(self):
|
|
598
668
|
"""
|
|
599
|
-
|
|
669
|
+
Test that ReflectionConcrete.getPublicStaticMethods returns only public static methods.
|
|
600
670
|
|
|
601
|
-
|
|
602
|
-
|
|
671
|
+
Returns
|
|
672
|
+
-------
|
|
673
|
+
None
|
|
674
|
+
Asserts that only public static methods are included in the result.
|
|
603
675
|
"""
|
|
604
676
|
reflect = ReflectionConcrete(FakeClass)
|
|
605
677
|
public_static_methods = reflect.getPublicStaticMethods()
|
|
@@ -609,10 +681,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
609
681
|
|
|
610
682
|
async def testGetPublicStaticSyncMethods(self):
|
|
611
683
|
"""
|
|
612
|
-
|
|
684
|
+
Test that ReflectionConcrete.getPublicStaticSyncMethods returns only public static sync methods.
|
|
613
685
|
|
|
614
|
-
|
|
615
|
-
|
|
686
|
+
Returns
|
|
687
|
+
-------
|
|
688
|
+
None
|
|
689
|
+
Asserts that only public static sync methods are included in the result.
|
|
616
690
|
"""
|
|
617
691
|
reflect = ReflectionConcrete(FakeClass)
|
|
618
692
|
public_static_sync_methods = reflect.getPublicStaticSyncMethods()
|
|
@@ -622,10 +696,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
622
696
|
|
|
623
697
|
async def testGetPublicStaticAsyncMethods(self):
|
|
624
698
|
"""
|
|
625
|
-
|
|
699
|
+
Test that ReflectionConcrete.getPublicStaticAsyncMethods returns only public static async methods.
|
|
626
700
|
|
|
627
|
-
|
|
628
|
-
|
|
701
|
+
Returns
|
|
702
|
+
-------
|
|
703
|
+
None
|
|
704
|
+
Asserts that only public static async methods are included in the result.
|
|
629
705
|
"""
|
|
630
706
|
reflect = ReflectionConcrete(FakeClass)
|
|
631
707
|
public_static_async_methods = reflect.getPublicStaticAsyncMethods()
|
|
@@ -635,10 +711,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
635
711
|
|
|
636
712
|
async def testGetProtectedStaticMethods(self):
|
|
637
713
|
"""
|
|
638
|
-
|
|
714
|
+
Test that ReflectionConcrete.getProtectedStaticMethods returns only protected static methods.
|
|
639
715
|
|
|
640
|
-
|
|
641
|
-
|
|
716
|
+
Returns
|
|
717
|
+
-------
|
|
718
|
+
None
|
|
719
|
+
Asserts that only protected static methods are included in the result.
|
|
642
720
|
"""
|
|
643
721
|
reflect = ReflectionConcrete(FakeClass)
|
|
644
722
|
protected_static_methods = reflect.getProtectedStaticMethods()
|
|
@@ -648,10 +726,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
648
726
|
|
|
649
727
|
async def testGetProtectedStaticSyncMethods(self):
|
|
650
728
|
"""
|
|
651
|
-
|
|
729
|
+
Test that ReflectionConcrete.getProtectedStaticSyncMethods returns only protected static sync methods.
|
|
652
730
|
|
|
653
|
-
|
|
654
|
-
|
|
731
|
+
Returns
|
|
732
|
+
-------
|
|
733
|
+
None
|
|
734
|
+
Asserts that only protected static sync methods are included in the result.
|
|
655
735
|
"""
|
|
656
736
|
reflect = ReflectionConcrete(FakeClass)
|
|
657
737
|
protected_static_sync_methods = reflect.getProtectedStaticSyncMethods()
|
|
@@ -661,10 +741,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
661
741
|
|
|
662
742
|
async def testGetProtectedStaticAsyncMethods(self):
|
|
663
743
|
"""
|
|
664
|
-
|
|
744
|
+
Test that ReflectionConcrete.getProtectedStaticAsyncMethods returns only protected static async methods.
|
|
665
745
|
|
|
666
|
-
|
|
667
|
-
|
|
746
|
+
Returns
|
|
747
|
+
-------
|
|
748
|
+
None
|
|
749
|
+
Asserts that only protected static async methods are included in the result.
|
|
668
750
|
"""
|
|
669
751
|
reflect = ReflectionConcrete(FakeClass)
|
|
670
752
|
protected_static_async_methods = reflect.getProtectedStaticAsyncMethods()
|
|
@@ -674,10 +756,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
674
756
|
|
|
675
757
|
async def testGetPrivateStaticMethods(self):
|
|
676
758
|
"""
|
|
677
|
-
|
|
759
|
+
Test that ReflectionConcrete.getPrivateStaticMethods returns only private static methods.
|
|
678
760
|
|
|
679
|
-
|
|
680
|
-
|
|
761
|
+
Returns
|
|
762
|
+
-------
|
|
763
|
+
None
|
|
764
|
+
Asserts that only private static methods are included in the result.
|
|
681
765
|
"""
|
|
682
766
|
reflect = ReflectionConcrete(FakeClass)
|
|
683
767
|
private_static_methods = reflect.getPrivateStaticMethods()
|
|
@@ -687,10 +771,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
687
771
|
|
|
688
772
|
async def testGetPrivateStaticSyncMethods(self):
|
|
689
773
|
"""
|
|
690
|
-
|
|
774
|
+
Test that ReflectionConcrete.getPrivateStaticSyncMethods returns only private static sync methods.
|
|
691
775
|
|
|
692
|
-
|
|
693
|
-
|
|
776
|
+
Returns
|
|
777
|
+
-------
|
|
778
|
+
None
|
|
779
|
+
Asserts that only private static sync methods are included in the result.
|
|
694
780
|
"""
|
|
695
781
|
reflect = ReflectionConcrete(FakeClass)
|
|
696
782
|
private_static_sync_methods = reflect.getPrivateStaticSyncMethods()
|
|
@@ -700,10 +786,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
700
786
|
|
|
701
787
|
async def testGetPrivateStaticAsyncMethods(self):
|
|
702
788
|
"""
|
|
703
|
-
|
|
789
|
+
Test that ReflectionConcrete.getPrivateStaticAsyncMethods returns only private static async methods.
|
|
704
790
|
|
|
705
|
-
|
|
706
|
-
|
|
791
|
+
Returns
|
|
792
|
+
-------
|
|
793
|
+
None
|
|
794
|
+
Asserts that only private static async methods are included in the result.
|
|
707
795
|
"""
|
|
708
796
|
reflect = ReflectionConcrete(FakeClass)
|
|
709
797
|
private_static_async_methods = reflect.getPrivateStaticAsyncMethods()
|
|
@@ -713,9 +801,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
713
801
|
|
|
714
802
|
async def testGetDunderMethods(self):
|
|
715
803
|
"""
|
|
716
|
-
Test that
|
|
717
|
-
|
|
718
|
-
|
|
804
|
+
Test that ReflectionConcrete.getDunderMethods retrieves dunder (double underscore) methods.
|
|
805
|
+
|
|
806
|
+
Returns
|
|
807
|
+
-------
|
|
808
|
+
None
|
|
809
|
+
Asserts that '__init__' is present in the results.
|
|
719
810
|
"""
|
|
720
811
|
reflect = ReflectionConcrete(FakeClass)
|
|
721
812
|
dunder_methods = reflect.getDunderMethods()
|
|
@@ -723,9 +814,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
723
814
|
|
|
724
815
|
async def testGetMagicMethods(self):
|
|
725
816
|
"""
|
|
726
|
-
Test
|
|
727
|
-
|
|
728
|
-
|
|
817
|
+
Test that ReflectionConcrete.getMagicMethods retrieves magic methods.
|
|
818
|
+
|
|
819
|
+
Returns
|
|
820
|
+
-------
|
|
821
|
+
None
|
|
822
|
+
Asserts that '__init__' is present in the results.
|
|
729
823
|
"""
|
|
730
824
|
reflect = ReflectionConcrete(FakeClass)
|
|
731
825
|
magic_methods = reflect.getMagicMethods()
|
|
@@ -733,9 +827,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
733
827
|
|
|
734
828
|
async def testGetProperties(self):
|
|
735
829
|
"""
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
830
|
+
Test that ReflectionConcrete.getProperties returns properties of FakeClass.
|
|
831
|
+
|
|
832
|
+
Returns
|
|
833
|
+
-------
|
|
834
|
+
None
|
|
835
|
+
Asserts that public, protected, and private properties are present in the result.
|
|
739
836
|
"""
|
|
740
837
|
reflect = ReflectionConcrete(FakeClass)
|
|
741
838
|
properties = reflect.getProperties()
|
|
@@ -745,10 +842,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
745
842
|
|
|
746
843
|
async def testGetPublicProperties(self):
|
|
747
844
|
"""
|
|
748
|
-
|
|
845
|
+
Test that ReflectionConcrete.getPublicProperties returns only public properties.
|
|
749
846
|
|
|
750
|
-
|
|
751
|
-
|
|
847
|
+
Returns
|
|
848
|
+
-------
|
|
849
|
+
None
|
|
850
|
+
Asserts that only public properties are included in the result.
|
|
752
851
|
"""
|
|
753
852
|
reflect = ReflectionConcrete(FakeClass)
|
|
754
853
|
public_properties = reflect.getPublicProperties()
|
|
@@ -758,10 +857,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
758
857
|
|
|
759
858
|
async def testGetProtectedProperties(self):
|
|
760
859
|
"""
|
|
761
|
-
|
|
860
|
+
Test that ReflectionConcrete.getProtectedProperties returns only protected properties.
|
|
762
861
|
|
|
763
|
-
|
|
764
|
-
|
|
862
|
+
Returns
|
|
863
|
+
-------
|
|
864
|
+
None
|
|
865
|
+
Asserts that only protected properties are included in the result.
|
|
765
866
|
"""
|
|
766
867
|
reflect = ReflectionConcrete(FakeClass)
|
|
767
868
|
protected_properties = reflect.getProtectedProperties()
|
|
@@ -771,10 +872,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
771
872
|
|
|
772
873
|
async def testGetPrivateProperties(self):
|
|
773
874
|
"""
|
|
774
|
-
|
|
875
|
+
Test that ReflectionConcrete.getPrivateProperties returns only private properties.
|
|
775
876
|
|
|
776
|
-
|
|
777
|
-
|
|
877
|
+
Returns
|
|
878
|
+
-------
|
|
879
|
+
None
|
|
880
|
+
Asserts that only private properties are included in the result.
|
|
778
881
|
"""
|
|
779
882
|
reflect = ReflectionConcrete(FakeClass)
|
|
780
883
|
private_properties = reflect.getPrivateProperties()
|
|
@@ -784,10 +887,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
784
887
|
|
|
785
888
|
async def testGetProperty(self):
|
|
786
889
|
"""
|
|
787
|
-
|
|
890
|
+
Test that ReflectionConcrete.getProperty returns the correct value for a property.
|
|
788
891
|
|
|
789
|
-
|
|
790
|
-
|
|
892
|
+
Returns
|
|
893
|
+
-------
|
|
894
|
+
None
|
|
895
|
+
Asserts that the returned value matches the expected value for the property.
|
|
791
896
|
"""
|
|
792
897
|
reflect = ReflectionConcrete(FakeClass)
|
|
793
898
|
value = reflect.getProperty('computed_public_property')
|
|
@@ -795,7 +900,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
795
900
|
|
|
796
901
|
async def testGetPropertySignature(self):
|
|
797
902
|
"""
|
|
798
|
-
|
|
903
|
+
Test that ReflectionConcrete.getPropertySignature returns the correct signature for a property.
|
|
904
|
+
|
|
905
|
+
Returns
|
|
906
|
+
-------
|
|
907
|
+
None
|
|
908
|
+
Asserts that the returned signature matches the expected format.
|
|
799
909
|
"""
|
|
800
910
|
reflect = ReflectionConcrete(FakeClass)
|
|
801
911
|
signature = reflect.getPropertySignature('computed_public_property')
|
|
@@ -803,19 +913,25 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
803
913
|
|
|
804
914
|
async def testGetPropertyDocstring(self):
|
|
805
915
|
"""
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
916
|
+
Test that ReflectionConcrete.getPropertyDocstring returns the correct docstring for a property.
|
|
917
|
+
|
|
918
|
+
Returns
|
|
919
|
+
-------
|
|
920
|
+
None
|
|
921
|
+
Asserts that the returned docstring matches the expected value.
|
|
809
922
|
"""
|
|
810
923
|
reflect = ReflectionConcrete(FakeClass)
|
|
811
924
|
docstring = reflect.getPropertyDocstring('computed_public_property')
|
|
812
|
-
self.assertIn('Returns
|
|
925
|
+
self.assertIn('Returns a string indicating this is a public', docstring)
|
|
813
926
|
|
|
814
927
|
async def testGetConstructorDependencies(self):
|
|
815
928
|
"""
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
929
|
+
Test that ReflectionConcrete.getConstructorDependencies returns the correct constructor dependencies.
|
|
930
|
+
|
|
931
|
+
Returns
|
|
932
|
+
-------
|
|
933
|
+
None
|
|
934
|
+
Asserts that the returned dependencies are a ClassDependency object.
|
|
819
935
|
"""
|
|
820
936
|
reflect = ReflectionConcrete(FakeClass)
|
|
821
937
|
dependencies = reflect.getConstructorDependencies()
|
|
@@ -823,9 +939,12 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
823
939
|
|
|
824
940
|
async def testGetMethodDependencies(self):
|
|
825
941
|
"""
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
942
|
+
Test that ReflectionConcrete.getMethodDependencies returns correct method dependencies.
|
|
943
|
+
|
|
944
|
+
Returns
|
|
945
|
+
-------
|
|
946
|
+
None
|
|
947
|
+
Asserts that the returned dependencies for 'instanceSyncMethod' are as expected.
|
|
829
948
|
"""
|
|
830
949
|
reflect = ReflectionConcrete(FakeClass)
|
|
831
950
|
method_deps = reflect.getMethodDependencies('instanceSyncMethod')
|