orionis 0.301.0__py3-none-any.whl → 0.303.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/metadata/framework.py +1 -1
- orionis/services/introspection/abstract/__init__.py +0 -0
- orionis/services/introspection/abstract/contracts/__init__.py +0 -0
- orionis/services/introspection/abstract/contracts/reflection_abstract.py +893 -0
- orionis/services/introspection/abstract/reflection_abstract.py +1266 -0
- orionis/services/introspection/concretes/reflection_concrete.py +4 -1
- orionis/services/introspection/instances/reflection_instance.py +4 -1
- orionis/services/introspection/modules/__init__.py +0 -0
- orionis/services/introspection/modules/contracts/__init__.py +0 -0
- orionis/services/introspection/modules/contracts/reflection_instance.py +380 -0
- orionis/services/introspection/modules/reflection_instance.py +500 -0
- orionis/test/suites/contracts/test_suite.py +0 -12
- orionis/test/suites/contracts/test_unit.py +54 -1
- orionis/test/suites/test_suite.py +4 -16
- orionis/test/suites/test_unit.py +81 -21
- {orionis-0.301.0.dist-info → orionis-0.303.0.dist-info}/METADATA +1 -1
- {orionis-0.301.0.dist-info → orionis-0.303.0.dist-info}/RECORD +23 -15
- tests/example/test_example.py +2 -2
- tests/support/inspection/fakes/fake_reflect_instance.py +237 -1
- {orionis-0.301.0.dist-info → orionis-0.303.0.dist-info}/WHEEL +0 -0
- {orionis-0.301.0.dist-info → orionis-0.303.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.301.0.dist-info → orionis-0.303.0.dist-info}/top_level.txt +0 -0
- {orionis-0.301.0.dist-info → orionis-0.303.0.dist-info}/zip-safe +0 -0
orionis/test/suites/test_unit.py
CHANGED
@@ -134,6 +134,9 @@ class UnitTest(IUnitTest):
|
|
134
134
|
self.web_report: bool = False
|
135
135
|
self.base_path: str = "tests"
|
136
136
|
self.withliveconsole: bool = True
|
137
|
+
self.__output_buffer = None
|
138
|
+
self.__error_buffer = None
|
139
|
+
self.__result = None
|
137
140
|
|
138
141
|
def configure(
|
139
142
|
self,
|
@@ -408,31 +411,34 @@ class UnitTest(IUnitTest):
|
|
408
411
|
self._startMessage()
|
409
412
|
|
410
413
|
# Prepare the running message based on whether live console is enabled
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
414
|
+
if self.print_result:
|
415
|
+
message = "[bold yellow]⏳ Running tests...[/bold yellow]\n"
|
416
|
+
message += "[dim]This may take a few seconds. Please wait...[/dim]" if self.withliveconsole else "[dim]Please wait, results will appear below...[/dim]"
|
417
|
+
|
418
|
+
# Panel for running message
|
419
|
+
running_panel = Panel(
|
420
|
+
message,
|
421
|
+
border_style="yellow",
|
422
|
+
title="In Progress",
|
423
|
+
title_align="left",
|
424
|
+
width=self.width_output_component,
|
425
|
+
padding=(1, 2)
|
426
|
+
)
|
423
427
|
|
424
|
-
|
425
|
-
|
426
|
-
|
428
|
+
# Elegant "running" message using Rich Panel
|
429
|
+
if self.withliveconsole:
|
430
|
+
with Live(running_panel, console=self.rich_console, refresh_per_second=4, transient=True):
|
431
|
+
result, output_buffer, error_buffer = self._runSuite()
|
432
|
+
else:
|
433
|
+
self.rich_console.print(running_panel)
|
427
434
|
result, output_buffer, error_buffer = self._runSuite()
|
428
435
|
else:
|
429
|
-
|
436
|
+
# If not printing results, run the suite without live console
|
430
437
|
result, output_buffer, error_buffer = self._runSuite()
|
431
438
|
|
432
|
-
#
|
433
|
-
|
434
|
-
|
435
|
-
print(output_buffer.getvalue())
|
439
|
+
# Save Outputs
|
440
|
+
self.__output_buffer = output_buffer.getvalue()
|
441
|
+
self.__error_buffer = error_buffer.getvalue()
|
436
442
|
|
437
443
|
# Process results
|
438
444
|
execution_time = time.time() - self.start_time
|
@@ -447,6 +453,7 @@ class UnitTest(IUnitTest):
|
|
447
453
|
raise OrionisTestFailureException(result)
|
448
454
|
|
449
455
|
# Return the summary of the test results
|
456
|
+
self.__result = summary
|
450
457
|
return summary
|
451
458
|
|
452
459
|
def _withLiveConsole(self) -> None:
|
@@ -1366,4 +1373,57 @@ class UnitTest(IUnitTest):
|
|
1366
1373
|
|
1367
1374
|
Resets the internal test suite to an empty `unittest.TestSuite`, removing any previously added tests.
|
1368
1375
|
"""
|
1369
|
-
self.suite = unittest.TestSuite()
|
1376
|
+
self.suite = unittest.TestSuite()
|
1377
|
+
|
1378
|
+
def getResult(self) -> dict:
|
1379
|
+
"""
|
1380
|
+
Returns the results of the executed test suite.
|
1381
|
+
|
1382
|
+
Returns
|
1383
|
+
-------
|
1384
|
+
UnitTest
|
1385
|
+
The result of the executed test suite.
|
1386
|
+
"""
|
1387
|
+
return self.__result
|
1388
|
+
|
1389
|
+
def getOutputBuffer(self) -> int:
|
1390
|
+
"""
|
1391
|
+
Returns the output buffer used for capturing test results.
|
1392
|
+
This method returns the internal output buffer that collects the results of the test execution.
|
1393
|
+
Returns
|
1394
|
+
-------
|
1395
|
+
int
|
1396
|
+
The output buffer containing the results of the test execution.
|
1397
|
+
"""
|
1398
|
+
return self.__output_buffer
|
1399
|
+
|
1400
|
+
def printOutputBuffer(self) -> None:
|
1401
|
+
"""
|
1402
|
+
Prints the contents of the output buffer to the console.
|
1403
|
+
This method retrieves the output buffer and prints its contents using the rich console.
|
1404
|
+
"""
|
1405
|
+
if self.__output_buffer:
|
1406
|
+
print(self.__output_buffer)
|
1407
|
+
else:
|
1408
|
+
print("No output buffer available.")
|
1409
|
+
|
1410
|
+
def getErrorBuffer(self) -> int:
|
1411
|
+
"""
|
1412
|
+
Returns the error buffer used for capturing test errors.
|
1413
|
+
This method returns the internal error buffer that collects any errors encountered during test execution.
|
1414
|
+
Returns
|
1415
|
+
-------
|
1416
|
+
int
|
1417
|
+
The error buffer containing the errors encountered during the test execution.
|
1418
|
+
"""
|
1419
|
+
return self.__error_buffer
|
1420
|
+
|
1421
|
+
def printErrorBuffer(self) -> None:
|
1422
|
+
"""
|
1423
|
+
Prints the contents of the error buffer to the console.
|
1424
|
+
This method retrieves the error buffer and prints its contents using the rich console.
|
1425
|
+
"""
|
1426
|
+
if self.__error_buffer:
|
1427
|
+
print(self.__error_buffer)
|
1428
|
+
else:
|
1429
|
+
print("No error buffer available.")
|
@@ -226,7 +226,7 @@ orionis/foundation/config/testing/entities/testing.py,sha256=AuhPU9O15Aeqs8jQVHW
|
|
226
226
|
orionis/foundation/config/testing/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
227
227
|
orionis/foundation/config/testing/enums/test_mode.py,sha256=IbFpauu7J-iSAfmC8jDbmTEYl8eZr-AexL-lyOh8_74,337
|
228
228
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
229
|
-
orionis/metadata/framework.py,sha256=
|
229
|
+
orionis/metadata/framework.py,sha256=kIoAY-9EIV8ft4wGLndURXqO2u7xS8JlYni6JmXISSY,4960
|
230
230
|
orionis/metadata/package.py,sha256=tqLfBRo-w1j_GN4xvzUNFyweWYFS-qhSgAEc-AmCH1M,5452
|
231
231
|
orionis/patterns/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
232
232
|
orionis/patterns/singleton/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -249,8 +249,12 @@ orionis/services/environment/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5J
|
|
249
249
|
orionis/services/environment/exceptions/environment_value_error.py,sha256=Y3QTwzUrn0D5FqT7hI_9uCACVz473YhhoAFOx1-rcXE,627
|
250
250
|
orionis/services/environment/exceptions/environment_value_exception.py,sha256=zlxRFJwi0Yj-xFHQUvZ8X1ZlxRDDVv7Xcw-w4qCocL4,646
|
251
251
|
orionis/services/introspection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
252
|
+
orionis/services/introspection/abstract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
253
|
+
orionis/services/introspection/abstract/reflection_abstract.py,sha256=OwVPnVaRr6iXXluZgDIhHoGIQrIti25FY55gXr2VdgI,42737
|
254
|
+
orionis/services/introspection/abstract/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
255
|
+
orionis/services/introspection/abstract/contracts/reflection_abstract.py,sha256=MuVZ-BaDI0ilH6ENiVn6nRqx_kEdIp7vxwtxSIzfMFE,22371
|
252
256
|
orionis/services/introspection/concretes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
253
|
-
orionis/services/introspection/concretes/reflection_concrete.py,sha256=
|
257
|
+
orionis/services/introspection/concretes/reflection_concrete.py,sha256=oji40QcV-i9IHdFhlqrMsxmOGmlIrpnz4Nix3ikz7Bg,49771
|
254
258
|
orionis/services/introspection/concretes/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
255
259
|
orionis/services/introspection/concretes/contracts/reflection_concrete.py,sha256=JiCgsmx-9M2a3PpAUOLeq2c0EkG231FArKYs54SeuRc,25068
|
256
260
|
orionis/services/introspection/dependencies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -266,9 +270,13 @@ orionis/services/introspection/exceptions/reflection_attribute_error.py,sha256=7
|
|
266
270
|
orionis/services/introspection/exceptions/reflection_type_error.py,sha256=6BizQOgt50qlLPDBvBJfUWgAwAr_8GAk1FhownPs-8A,747
|
267
271
|
orionis/services/introspection/exceptions/reflection_value_error.py,sha256=X38649JMKSPbdpa1lmo69RhhTATH8ykTF-UAqe7IAaU,748
|
268
272
|
orionis/services/introspection/instances/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
269
|
-
orionis/services/introspection/instances/reflection_instance.py,sha256=
|
273
|
+
orionis/services/introspection/instances/reflection_instance.py,sha256=deqQpeAZquij7tMgcyuZaK09YGLkQb95OiZx5zEWiwk,51941
|
270
274
|
orionis/services/introspection/instances/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
271
275
|
orionis/services/introspection/instances/contracts/reflection_instance.py,sha256=zc-uOHDixR4Wg2PwF4mX9lpl-AGMKtMvJUN7_Pixr2Q,20938
|
276
|
+
orionis/services/introspection/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
277
|
+
orionis/services/introspection/modules/reflection_instance.py,sha256=9tLwz9J-ZzyBLNQ8lFU_U0_f2LFnoQBK5ObejOb9MHQ,15642
|
278
|
+
orionis/services/introspection/modules/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
279
|
+
orionis/services/introspection/modules/contracts/reflection_instance.py,sha256=YLqKg5EhaddUBrytMHX1-uz9mNsRISK1iVyG_iUiVYA,9666
|
272
280
|
orionis/services/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
273
281
|
orionis/services/parsers/serializer.py,sha256=mxWlzqgkoO7EeIr3MZ5gdzQUuSfjqWDMau85PEqlBQY,531
|
274
282
|
orionis/services/parsers/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -350,17 +358,17 @@ orionis/test/output/dumper.py,sha256=y-6du3n1IU2Cd2MFbMuEiLcpMqEOqENkuAXwMMhcsEI
|
|
350
358
|
orionis/test/output/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
351
359
|
orionis/test/output/contracts/dumper.py,sha256=5OqGc4GEXCXX76sCX185giQMyKwwZvlOv3I7tTwV2fQ,1324
|
352
360
|
orionis/test/suites/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
353
|
-
orionis/test/suites/test_suite.py,sha256=
|
354
|
-
orionis/test/suites/test_unit.py,sha256=
|
361
|
+
orionis/test/suites/test_suite.py,sha256=_EJ1xgCOc5MDp3bDI9bAqjCdoMPl8-UITeLClBPgtoE,5019
|
362
|
+
orionis/test/suites/test_unit.py,sha256=KFt2wnt1NBJnH8EZtET9hCVgIQYxVFBpG-jrvHlxXPI,57056
|
355
363
|
orionis/test/suites/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
356
|
-
orionis/test/suites/contracts/test_suite.py,sha256=
|
357
|
-
orionis/test/suites/contracts/test_unit.py,sha256=
|
364
|
+
orionis/test/suites/contracts/test_suite.py,sha256=LynUESckdIjgqG4VzyObS-lS47uDxIIVqD9Ja5oPj1M,795
|
365
|
+
orionis/test/suites/contracts/test_unit.py,sha256=YWpzXhjD-f-IGncKkGyE9C7tYCFbt9mxZPw1O_d5HOE,7532
|
358
366
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
359
367
|
orionis/test/view/render.py,sha256=jXZkbITBknbUwm_mD8bcTiwLDvsFkrO9qrf0ZgPwqxc,4903
|
360
|
-
orionis-0.
|
368
|
+
orionis-0.303.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
361
369
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
362
370
|
tests/example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
363
|
-
tests/example/test_example.py,sha256=
|
371
|
+
tests/example/test_example.py,sha256=kvWgiW3ADEZf718dGsMPtDh_rmOSx1ypEInKm7_6ZPQ,601
|
364
372
|
tests/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
365
373
|
tests/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
366
374
|
tests/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -454,15 +462,15 @@ tests/support/inspection/test_reflection_concrete_with_abstract.py,sha256=Qzd87J
|
|
454
462
|
tests/support/inspection/test_reflection_instance_with_abstract.py,sha256=L3nQy2l95yEIyvAHErqxGRVVF5x8YkyM82uGm0wUlxk,4064
|
455
463
|
tests/support/inspection/fakes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
456
464
|
tests/support/inspection/fakes/fake_reflect_abstract.py,sha256=woE15uLmoD3fLgPBMjNh5XkwvMDmW2VDbADYPIS_88o,6387
|
457
|
-
tests/support/inspection/fakes/fake_reflect_instance.py,sha256=
|
465
|
+
tests/support/inspection/fakes/fake_reflect_instance.py,sha256=WZsXKb8WQcP6Xz72ejrtqw6m2FMPl9HhhurkF1OyUC4,18248
|
458
466
|
tests/support/inspection/fakes/fake_reflection_concrete.py,sha256=j6gzsxE3xq5oJ30H_Hm1RsUwEY3jOYBu4sclxtD1ayo,1047
|
459
467
|
tests/support/inspection/fakes/fake_reflection_concrete_with_abstract.py,sha256=ibCjrtNM6BMf5Z5VMvat7E6zOAk5g9z--gj4ykKJWY8,2118
|
460
468
|
tests/support/inspection/fakes/fake_reflection_instance_with_abstract.py,sha256=SfL8FuFmr650RlzXTrP4tGMfsPVZLhOxVnBXu_g1POg,1471
|
461
469
|
tests/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
462
470
|
tests/testing/test_testing_result.py,sha256=MrGK3ZimedL0b5Ydu69Dg8Iul017AzLTm7VPxpXlpfU,4315
|
463
471
|
tests/testing/test_testing_unit.py,sha256=A6QkiOkP7GPC1Szh_GqsrV7GxjWjK8cIwFez6YfrzmM,7683
|
464
|
-
orionis-0.
|
465
|
-
orionis-0.
|
466
|
-
orionis-0.
|
467
|
-
orionis-0.
|
468
|
-
orionis-0.
|
472
|
+
orionis-0.303.0.dist-info/METADATA,sha256=3ZdPn1u-dHQHBN_Fbv38L2YTQXbYR2h3Wju1V7ur2rU,4772
|
473
|
+
orionis-0.303.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
474
|
+
orionis-0.303.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
475
|
+
orionis-0.303.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
476
|
+
orionis-0.303.0.dist-info/RECORD,,
|
tests/example/test_example.py
CHANGED
@@ -1,5 +1,115 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
1
2
|
import asyncio
|
2
3
|
|
4
|
+
PUBLIC_CONSTANT = "public constant"
|
5
|
+
_PROTECTED_CONSTANT = "protected constant"
|
6
|
+
__PRIVATE_CONSTANT = "private constant"
|
7
|
+
|
8
|
+
def publicSyncFunction(x: int, y: int) -> int:
|
9
|
+
"""
|
10
|
+
A public synchronous function that adds two integers.
|
11
|
+
|
12
|
+
Args:
|
13
|
+
x (int): The first integer.
|
14
|
+
y (int): The second integer.
|
15
|
+
|
16
|
+
Returns:
|
17
|
+
int: The sum of x and y.
|
18
|
+
"""
|
19
|
+
return x + y
|
20
|
+
|
21
|
+
async def publicAsyncFunction(x: int, y: int) -> int:
|
22
|
+
"""
|
23
|
+
A public asynchronous function that adds two integers.
|
24
|
+
|
25
|
+
Args:
|
26
|
+
x (int): The first integer.
|
27
|
+
y (int): The second integer.
|
28
|
+
|
29
|
+
Returns:
|
30
|
+
int: The sum of x and y.
|
31
|
+
"""
|
32
|
+
await asyncio.sleep(0.1)
|
33
|
+
return x + y
|
34
|
+
|
35
|
+
def _protectedSyncFunction(x: int, y: int) -> int:
|
36
|
+
"""
|
37
|
+
A protected synchronous function that adds two integers.
|
38
|
+
|
39
|
+
Args:
|
40
|
+
x (int): The first integer.
|
41
|
+
y (int): The second integer.
|
42
|
+
|
43
|
+
Returns:
|
44
|
+
int: The sum of x and y.
|
45
|
+
"""
|
46
|
+
return x + y
|
47
|
+
|
48
|
+
async def _protectedAsyncFunction(x: int, y: int) -> int:
|
49
|
+
"""
|
50
|
+
A protected asynchronous function that adds two integers.
|
51
|
+
|
52
|
+
Args:
|
53
|
+
x (int): The first integer.
|
54
|
+
y (int): The second integer.
|
55
|
+
|
56
|
+
Returns:
|
57
|
+
int: The sum of x and y.
|
58
|
+
"""
|
59
|
+
await asyncio.sleep(0.1)
|
60
|
+
return x + y
|
61
|
+
|
62
|
+
def __privateSyncFunction(x: int, y: int) -> int:
|
63
|
+
"""
|
64
|
+
A private synchronous function that adds two integers.
|
65
|
+
|
66
|
+
Args:
|
67
|
+
x (int): The first integer.
|
68
|
+
y (int): The second integer.
|
69
|
+
|
70
|
+
Returns:
|
71
|
+
int: The sum of x and y.
|
72
|
+
"""
|
73
|
+
return x + y
|
74
|
+
|
75
|
+
async def __privateAsyncFunction(x: int, y: int) -> int:
|
76
|
+
"""
|
77
|
+
A private asynchronous function that adds two integers.
|
78
|
+
|
79
|
+
Args:
|
80
|
+
x (int): The first integer.
|
81
|
+
y (int): The second integer.
|
82
|
+
|
83
|
+
Returns:
|
84
|
+
int: The sum of x and y.
|
85
|
+
"""
|
86
|
+
await asyncio.sleep(0.1)
|
87
|
+
return x + y
|
88
|
+
|
89
|
+
class PublicFakeClass:
|
90
|
+
"""
|
91
|
+
A public class for creating fake or mock classes in tests.
|
92
|
+
|
93
|
+
This class serves as a simple parent class for test doubles used in inspection-related tests.
|
94
|
+
"""
|
95
|
+
pass
|
96
|
+
|
97
|
+
class _ProtectedFakeClass:
|
98
|
+
"""
|
99
|
+
A protected class for creating fake or mock classes in tests.
|
100
|
+
|
101
|
+
This class serves as a simple parent class for test doubles used in inspection-related tests.
|
102
|
+
"""
|
103
|
+
pass
|
104
|
+
|
105
|
+
class __PrivateFakeClass:
|
106
|
+
"""
|
107
|
+
A private class for creating fake or mock classes in tests.
|
108
|
+
|
109
|
+
This class serves as a simple parent class for test doubles used in inspection-related tests.
|
110
|
+
"""
|
111
|
+
pass
|
112
|
+
|
3
113
|
class BaseFakeClass:
|
4
114
|
"""
|
5
115
|
A base class for creating fake or mock classes in tests.
|
@@ -378,4 +488,130 @@ class FakeClass(BaseFakeClass):
|
|
378
488
|
str: The uppercase version of the input string.
|
379
489
|
"""
|
380
490
|
await asyncio.sleep(0.1)
|
381
|
-
return text.upper()
|
491
|
+
return text.upper()
|
492
|
+
|
493
|
+
class AbstractFakeClass(ABC):
|
494
|
+
|
495
|
+
"""
|
496
|
+
AbstractFakeClass es una clase abstracta basada en FakeClass, diseñada para simular atributos y métodos de diferentes niveles de visibilidad.
|
497
|
+
Define métodos y propiedades abstractas para ser implementadas por subclases concretas.
|
498
|
+
"""
|
499
|
+
|
500
|
+
# Atributos de clase
|
501
|
+
public_attr: int = 42
|
502
|
+
dynamic_attr = None
|
503
|
+
_protected_attr: str = "protected"
|
504
|
+
__private_attr: str = "private"
|
505
|
+
__dd__: str = "dunder_value"
|
506
|
+
|
507
|
+
@property
|
508
|
+
@abstractmethod
|
509
|
+
def computed_public_property(self) -> str:
|
510
|
+
"""Propiedad pública computada."""
|
511
|
+
pass
|
512
|
+
|
513
|
+
@property
|
514
|
+
@abstractmethod
|
515
|
+
def _computed_property_protected(self) -> str:
|
516
|
+
"""Propiedad protegida computada."""
|
517
|
+
pass
|
518
|
+
|
519
|
+
@property
|
520
|
+
@abstractmethod
|
521
|
+
def __computed_property_private(self) -> str:
|
522
|
+
"""Propiedad privada computada."""
|
523
|
+
pass
|
524
|
+
|
525
|
+
def __init__(self) -> None:
|
526
|
+
self.public_attr = 42
|
527
|
+
self.dynamic_attr = None
|
528
|
+
self._protected_attr = "protected"
|
529
|
+
self.__private_attr = "private"
|
530
|
+
self.__dd__ = "dunder_value"
|
531
|
+
|
532
|
+
# Métodos de instancia
|
533
|
+
@abstractmethod
|
534
|
+
def instanceSyncMethod(self, x: int, y: int) -> int:
|
535
|
+
pass
|
536
|
+
|
537
|
+
@abstractmethod
|
538
|
+
async def instanceAsyncMethod(self, x: int, y: int) -> int:
|
539
|
+
pass
|
540
|
+
|
541
|
+
@abstractmethod
|
542
|
+
def _protectedsyncMethod(self, x: int, y: int) -> int:
|
543
|
+
pass
|
544
|
+
|
545
|
+
@abstractmethod
|
546
|
+
async def _protectedAsyncMethod(self, x: int, y: int) -> int:
|
547
|
+
pass
|
548
|
+
|
549
|
+
@abstractmethod
|
550
|
+
def __privateSyncMethod(self, x: int, y: int) -> int:
|
551
|
+
pass
|
552
|
+
|
553
|
+
@abstractmethod
|
554
|
+
async def __privateAsyncMethod(self, x: int, y: int) -> int:
|
555
|
+
pass
|
556
|
+
|
557
|
+
# Métodos de clase
|
558
|
+
@classmethod
|
559
|
+
@abstractmethod
|
560
|
+
def classSyncMethod(cls, x: int, y: int) -> int:
|
561
|
+
pass
|
562
|
+
|
563
|
+
@classmethod
|
564
|
+
@abstractmethod
|
565
|
+
async def classAsyncMethod(cls, x: int, y: int) -> int:
|
566
|
+
pass
|
567
|
+
|
568
|
+
@classmethod
|
569
|
+
@abstractmethod
|
570
|
+
def _classMethodProtected(cls, x: int, y: int) -> int:
|
571
|
+
pass
|
572
|
+
|
573
|
+
@classmethod
|
574
|
+
@abstractmethod
|
575
|
+
async def _classAsyncMethodProtected(cls, x: int, y: int) -> int:
|
576
|
+
pass
|
577
|
+
|
578
|
+
@classmethod
|
579
|
+
@abstractmethod
|
580
|
+
def __classMethodPrivate(cls, x: int, y: int) -> int:
|
581
|
+
pass
|
582
|
+
|
583
|
+
@classmethod
|
584
|
+
@abstractmethod
|
585
|
+
async def __classAsyncMethodPrivate(cls, x: int, y: int) -> int:
|
586
|
+
pass
|
587
|
+
|
588
|
+
# Métodos estáticos
|
589
|
+
@staticmethod
|
590
|
+
@abstractmethod
|
591
|
+
def staticMethod(text: str) -> str:
|
592
|
+
pass
|
593
|
+
|
594
|
+
@staticmethod
|
595
|
+
@abstractmethod
|
596
|
+
async def staticAsyncMethod(text: str) -> str:
|
597
|
+
pass
|
598
|
+
|
599
|
+
@staticmethod
|
600
|
+
@abstractmethod
|
601
|
+
def _staticMethodProtected(text: str) -> str:
|
602
|
+
pass
|
603
|
+
|
604
|
+
@staticmethod
|
605
|
+
@abstractmethod
|
606
|
+
async def _staticAsyncMethodProtected(text: str) -> str:
|
607
|
+
pass
|
608
|
+
|
609
|
+
@staticmethod
|
610
|
+
@abstractmethod
|
611
|
+
def __staticMethodPrivate(text: str) -> str:
|
612
|
+
pass
|
613
|
+
|
614
|
+
@staticmethod
|
615
|
+
@abstractmethod
|
616
|
+
async def __staticAsyncMethodPrivate(text: str) -> str:
|
617
|
+
pass
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|