orionis 0.300.0__py3-none-any.whl → 0.302.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/contracts/__init__.py +0 -0
- orionis/services/introspection/concretes/contracts/reflection_concrete.py +997 -0
- orionis/services/introspection/concretes/reflection_concrete.py +23 -9
- 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-0.300.0.dist-info → orionis-0.302.0.dist-info}/METADATA +1 -1
- {orionis-0.300.0.dist-info → orionis-0.302.0.dist-info}/RECORD +21 -11
- tests/example/test_example.py +1 -1
- tests/support/inspection/fakes/fake_reflect_instance.py +237 -1
- {orionis-0.300.0.dist-info → orionis-0.302.0.dist-info}/WHEEL +0 -0
- {orionis-0.300.0.dist-info → orionis-0.302.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.300.0.dist-info → orionis-0.302.0.dist-info}/top_level.txt +0 -0
- {orionis-0.300.0.dist-info → orionis-0.302.0.dist-info}/zip-safe +0 -0
@@ -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
|