orionis 0.546.0__py3-none-any.whl → 0.547.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- orionis/console/base/scheduler_event_listener.py +0 -17
- orionis/console/contracts/schedule_event_listener.py +0 -18
- orionis/foundation/config/app/entities/app.py +3 -2
- orionis/foundation/config/app/enums/ciphers.py +5 -19
- orionis/foundation/config/session/entities/session.py +2 -2
- orionis/metadata/framework.py +1 -1
- orionis/services/encrypter/encrypter.py +115 -0
- orionis/services/environment/dynamic/caster.py +35 -27
- orionis/services/environment/key/key_generator.py +32 -11
- {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/METADATA +1 -1
- {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/RECORD +15 -159
- {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/top_level.txt +0 -1
- tests/container/__init__.py +0 -0
- tests/container/context/__init__.py +0 -0
- tests/container/context/test_manager.py +0 -38
- tests/container/context/test_scope.py +0 -32
- tests/container/core/__init__.py +0 -0
- tests/container/core/test_advanced_async.py +0 -234
- tests/container/core/test_async_optimizations.py +0 -268
- tests/container/core/test_container.py +0 -453
- tests/container/core/test_singleton.py +0 -122
- tests/container/core/test_thread_safety.py +0 -90
- tests/container/entities/__init__.py +0 -0
- tests/container/entities/test_binding.py +0 -242
- tests/container/enums/__init__.py +0 -0
- tests/container/enums/test_lifetimes.py +0 -97
- tests/container/facades/__init__.py +0 -0
- tests/container/facades/test_facade.py +0 -78
- tests/container/mocks/__init__.py +0 -0
- tests/container/mocks/mock_advanced_async.py +0 -332
- tests/container/mocks/mock_async_optimizations.py +0 -407
- tests/container/mocks/mock_auto_resolution.py +0 -192
- tests/container/mocks/mock_complex_classes.py +0 -792
- tests/container/mocks/mock_simple_classes.py +0 -98
- tests/container/providers/__init__.py +0 -0
- tests/container/providers/test_providers.py +0 -55
- tests/container/validators/__init__.py +0 -0
- tests/container/validators/test_implements.py +0 -186
- tests/container/validators/test_is_abstract_class.py +0 -147
- tests/container/validators/test_is_callable.py +0 -102
- tests/container/validators/test_is_concrete_class.py +0 -160
- tests/container/validators/test_is_instance.py +0 -150
- tests/container/validators/test_is_not_subclass.py +0 -49
- tests/container/validators/test_is_subclass.py +0 -178
- tests/container/validators/test_is_valid_alias.py +0 -147
- tests/container/validators/test_lifetime.py +0 -106
- tests/example/__init__.py +0 -0
- tests/example/test_example.py +0 -725
- tests/foundation/__init__.py +0 -0
- tests/foundation/config/__init__.py +0 -0
- tests/foundation/config/app/__init__.py +0 -0
- tests/foundation/config/app/test_foundation_config_app.py +0 -262
- tests/foundation/config/auth/__init__.py +0 -0
- tests/foundation/config/auth/test_foundation_config_auth.py +0 -29
- tests/foundation/config/cache/__init__.py +0 -0
- tests/foundation/config/cache/test_foundation_config_cache.py +0 -143
- tests/foundation/config/cache/test_foundation_config_cache_file.py +0 -126
- tests/foundation/config/cache/test_foundation_config_cache_stores.py +0 -156
- tests/foundation/config/cors/__init__.py +0 -0
- tests/foundation/config/cors/test_foundation_config_cors.py +0 -190
- tests/foundation/config/database/__init__.py +0 -0
- tests/foundation/config/database/test_foundation_config_database.py +0 -158
- tests/foundation/config/database/test_foundation_config_database_connections.py +0 -203
- tests/foundation/config/database/test_foundation_config_database_mysql.py +0 -354
- tests/foundation/config/database/test_foundation_config_database_oracle.py +0 -288
- tests/foundation/config/database/test_foundation_config_database_pgsql.py +0 -257
- tests/foundation/config/database/test_foundation_config_database_sqlite.py +0 -207
- tests/foundation/config/filesystems/__init__.py +0 -0
- tests/foundation/config/filesystems/test_foundation_config_filesystems.py +0 -160
- tests/foundation/config/filesystems/test_foundation_config_filesystems_aws.py +0 -189
- tests/foundation/config/filesystems/test_foundation_config_filesystems_disks.py +0 -184
- tests/foundation/config/filesystems/test_foundation_config_filesystems_local.py +0 -143
- tests/foundation/config/filesystems/test_foundation_config_filesystems_public.py +0 -184
- tests/foundation/config/logging/__init__.py +0 -0
- tests/foundation/config/logging/test_foundation_config_logging.py +0 -112
- tests/foundation/config/logging/test_foundation_config_logging_channels.py +0 -246
- tests/foundation/config/logging/test_foundation_config_logging_chunked.py +0 -217
- tests/foundation/config/logging/test_foundation_config_logging_daily.py +0 -220
- tests/foundation/config/logging/test_foundation_config_logging_hourly.py +0 -196
- tests/foundation/config/logging/test_foundation_config_logging_monthly.py +0 -214
- tests/foundation/config/logging/test_foundation_config_logging_stack.py +0 -178
- tests/foundation/config/logging/test_foundation_config_logging_weekly.py +0 -224
- tests/foundation/config/mail/__init__.py +0 -0
- tests/foundation/config/mail/test_foundation_config_mail.py +0 -145
- tests/foundation/config/mail/test_foundation_config_mail_file.py +0 -97
- tests/foundation/config/mail/test_foundation_config_mail_mailers.py +0 -106
- tests/foundation/config/mail/test_foundation_config_mail_smtp.py +0 -146
- tests/foundation/config/queue/__init__.py +0 -0
- tests/foundation/config/queue/test_foundation_config_queue.py +0 -88
- tests/foundation/config/queue/test_foundation_config_queue_brokers.py +0 -72
- tests/foundation/config/queue/test_foundation_config_queue_database.py +0 -134
- tests/foundation/config/root/__init__.py +0 -0
- tests/foundation/config/root/test_foundation_config_root_paths.py +0 -112
- tests/foundation/config/session/__init__.py +0 -0
- tests/foundation/config/session/test_foundation_config_session.py +0 -213
- tests/foundation/config/startup/__init__.py +0 -0
- tests/foundation/config/startup/test_foundation_config_startup.py +0 -202
- tests/foundation/config/testing/__init__.py +0 -0
- tests/foundation/config/testing/test_foundation_config_testing.py +0 -235
- tests/metadata/__init__.py +0 -0
- tests/metadata/test_metadata_framework.py +0 -140
- tests/metadata/test_metadata_package.py +0 -139
- tests/services/__init__.py +0 -0
- tests/services/asynchrony/__init__.py +0 -0
- tests/services/asynchrony/test_services_asynchrony_coroutine.py +0 -85
- tests/services/environment/__init__.py +0 -0
- tests/services/environment/test_services_environment.py +0 -226
- tests/services/introspection/__init__.py +0 -0
- tests/services/introspection/dependencies/__init__.py +0 -0
- tests/services/introspection/dependencies/mocks/__init__.py +0 -0
- tests/services/introspection/dependencies/mocks/mock_user.py +0 -30
- tests/services/introspection/dependencies/mocks/mock_user_controller.py +0 -27
- tests/services/introspection/dependencies/mocks/mock_users_permissions.py +0 -41
- tests/services/introspection/dependencies/test_reflect_dependencies.py +0 -261
- tests/services/introspection/reflection/__init__.py +0 -0
- tests/services/introspection/reflection/mock/__init__.py +0 -0
- tests/services/introspection/reflection/mock/fake_reflect_instance.py +0 -1115
- tests/services/introspection/reflection/test_reflection_abstract.py +0 -1011
- tests/services/introspection/reflection/test_reflection_callable.py +0 -206
- tests/services/introspection/reflection/test_reflection_concrete.py +0 -952
- tests/services/introspection/reflection/test_reflection_instance.py +0 -1233
- tests/services/introspection/reflection/test_reflection_module.py +0 -567
- tests/services/introspection/test_reflection.py +0 -462
- tests/services/log/__init__.py +0 -0
- tests/services/log/test_log.py +0 -97
- tests/services/system/__init__.py +0 -0
- tests/services/system/test_services_system_imports.py +0 -204
- tests/services/system/test_services_system_workers.py +0 -131
- tests/support/__init__.py +0 -0
- tests/support/entities/__init__.py +0 -0
- tests/support/entities/mock_dataclass.py +0 -40
- tests/support/entities/test_base.py +0 -64
- tests/support/patterns/__init__.py +0 -0
- tests/support/patterns/singleton/__init__.py +0 -0
- tests/support/patterns/singleton/test_patterns_singleton.py +0 -39
- tests/support/standard/__init__.py +0 -0
- tests/support/standard/test_services_std.py +0 -226
- tests/support/wrapper/__init__.py +0 -0
- tests/support/wrapper/test_services_wrapper_docdict.py +0 -202
- tests/testing/__init__.py +0 -0
- tests/testing/cases/__init__.py +0 -0
- tests/testing/cases/test_testing_asynchronous.py +0 -63
- tests/testing/cases/test_testing_synchronous.py +0 -57
- tests/testing/entities/__init__.py +0 -0
- tests/testing/entities/test_testing_result.py +0 -146
- tests/testing/enums/__init__.py +0 -0
- tests/testing/enums/test_testing_status.py +0 -63
- tests/testing/output/__init__.py +0 -0
- tests/testing/output/test_testing_dumper.py +0 -29
- tests/testing/output/test_testing_printer.py +0 -42
- tests/testing/records/__init__.py +0 -0
- tests/testing/records/test_testing_records.py +0 -171
- tests/testing/test_testing_unit.py +0 -164
- tests/testing/validators/__init__.py +0 -0
- tests/testing/validators/test_testing_validators.py +0 -392
- tests/testing/view/__init__.py +0 -0
- tests/testing/view/test_render.py +0 -30
- {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/WHEEL +0 -0
- {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/zip-safe +0 -0
|
@@ -1,792 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
import asyncio
|
|
3
|
-
from tests.container.mocks.mock_simple_classes import ICar
|
|
4
|
-
|
|
5
|
-
def ejemplo(x:int = 3, y:int = 2):
|
|
6
|
-
"""
|
|
7
|
-
Add two integers together.
|
|
8
|
-
|
|
9
|
-
Parameters
|
|
10
|
-
----------
|
|
11
|
-
x : int, default 3
|
|
12
|
-
First integer operand.
|
|
13
|
-
y : int, default 2
|
|
14
|
-
Second integer operand.
|
|
15
|
-
|
|
16
|
-
Returns
|
|
17
|
-
-------
|
|
18
|
-
int
|
|
19
|
-
Sum of x and y.
|
|
20
|
-
"""
|
|
21
|
-
return x + y
|
|
22
|
-
|
|
23
|
-
class AbstractFakeClass(ABC):
|
|
24
|
-
"""
|
|
25
|
-
Abstract base class for testing attribute and method visibility patterns.
|
|
26
|
-
|
|
27
|
-
This class defines abstract methods and properties with different visibility
|
|
28
|
-
levels (public, protected, private) for testing purposes. It includes
|
|
29
|
-
synchronous and asynchronous methods as instance, class, and static methods.
|
|
30
|
-
|
|
31
|
-
Attributes
|
|
32
|
-
----------
|
|
33
|
-
public_attr : int
|
|
34
|
-
Public class attribute with default value 42.
|
|
35
|
-
dynamic_attr : Any
|
|
36
|
-
Dynamic attribute that can be set at runtime, initially None.
|
|
37
|
-
_protected_attr : str
|
|
38
|
-
Protected class attribute with default value "protected".
|
|
39
|
-
__private_attr : str
|
|
40
|
-
Private class attribute with default value "private".
|
|
41
|
-
__dd__ : str
|
|
42
|
-
Dunder attribute with default value "dunder_value".
|
|
43
|
-
|
|
44
|
-
Notes
|
|
45
|
-
-----
|
|
46
|
-
All methods are abstract and must be implemented by concrete subclasses.
|
|
47
|
-
This class serves as a template for testing different method and property
|
|
48
|
-
visibility patterns in Python.
|
|
49
|
-
"""
|
|
50
|
-
|
|
51
|
-
# Atributos de clase
|
|
52
|
-
public_attr: int = 42
|
|
53
|
-
dynamic_attr = None
|
|
54
|
-
_protected_attr: str = "protected"
|
|
55
|
-
__private_attr: str = "private"
|
|
56
|
-
__dd__: str = "dunder_value"
|
|
57
|
-
|
|
58
|
-
@property
|
|
59
|
-
@abstractmethod
|
|
60
|
-
def computed_public_property(self) -> str:
|
|
61
|
-
"""
|
|
62
|
-
Abstract property that computes and returns a public property value.
|
|
63
|
-
|
|
64
|
-
Returns
|
|
65
|
-
-------
|
|
66
|
-
str
|
|
67
|
-
The computed value of the public property.
|
|
68
|
-
"""
|
|
69
|
-
pass
|
|
70
|
-
|
|
71
|
-
@property
|
|
72
|
-
@abstractmethod
|
|
73
|
-
def _computed_property_protected(self) -> str:
|
|
74
|
-
"""
|
|
75
|
-
Abstract protected property that computes and returns a string value.
|
|
76
|
-
|
|
77
|
-
Returns
|
|
78
|
-
-------
|
|
79
|
-
str
|
|
80
|
-
The computed property as a string.
|
|
81
|
-
"""
|
|
82
|
-
pass
|
|
83
|
-
|
|
84
|
-
def __init__(self) -> None:
|
|
85
|
-
self.public_attr = 42
|
|
86
|
-
self.dynamic_attr = None
|
|
87
|
-
self._protected_attr = "protected"
|
|
88
|
-
self.__private_attr = "private"
|
|
89
|
-
self.__dd__ = "dunder_value"
|
|
90
|
-
|
|
91
|
-
# Métodos de instancia
|
|
92
|
-
@abstractmethod
|
|
93
|
-
def instanceSyncMethod(self, x: int, y: int) -> int:
|
|
94
|
-
"""
|
|
95
|
-
Abstract synchronous instance method for integer operations.
|
|
96
|
-
|
|
97
|
-
Parameters
|
|
98
|
-
----------
|
|
99
|
-
x : int
|
|
100
|
-
First integer operand.
|
|
101
|
-
y : int
|
|
102
|
-
Second integer operand.
|
|
103
|
-
|
|
104
|
-
Returns
|
|
105
|
-
-------
|
|
106
|
-
int
|
|
107
|
-
Result of the operation.
|
|
108
|
-
"""
|
|
109
|
-
pass
|
|
110
|
-
|
|
111
|
-
@abstractmethod
|
|
112
|
-
async def instanceAsyncMethod(self, x: int, y: int) -> int:
|
|
113
|
-
"""
|
|
114
|
-
Abstract asynchronous instance method for integer operations.
|
|
115
|
-
|
|
116
|
-
Parameters
|
|
117
|
-
----------
|
|
118
|
-
x : int
|
|
119
|
-
First integer operand.
|
|
120
|
-
y : int
|
|
121
|
-
Second integer operand.
|
|
122
|
-
|
|
123
|
-
Returns
|
|
124
|
-
-------
|
|
125
|
-
int
|
|
126
|
-
Result of the operation.
|
|
127
|
-
"""
|
|
128
|
-
pass
|
|
129
|
-
|
|
130
|
-
@abstractmethod
|
|
131
|
-
def _protectedsyncMethod(self, x: int, y: int) -> int:
|
|
132
|
-
"""
|
|
133
|
-
Abstract protected synchronous instance method for integer operations.
|
|
134
|
-
|
|
135
|
-
Parameters
|
|
136
|
-
----------
|
|
137
|
-
x : int
|
|
138
|
-
First integer operand.
|
|
139
|
-
y : int
|
|
140
|
-
Second integer operand.
|
|
141
|
-
|
|
142
|
-
Returns
|
|
143
|
-
-------
|
|
144
|
-
int
|
|
145
|
-
Result of the operation.
|
|
146
|
-
"""
|
|
147
|
-
pass
|
|
148
|
-
|
|
149
|
-
@abstractmethod
|
|
150
|
-
async def _protectedAsyncMethod(self, x: int, y: int) -> int:
|
|
151
|
-
"""
|
|
152
|
-
Abstract protected asynchronous instance method for integer operations.
|
|
153
|
-
|
|
154
|
-
Parameters
|
|
155
|
-
----------
|
|
156
|
-
x : int
|
|
157
|
-
First integer operand.
|
|
158
|
-
y : int
|
|
159
|
-
Second integer operand.
|
|
160
|
-
|
|
161
|
-
Returns
|
|
162
|
-
-------
|
|
163
|
-
int
|
|
164
|
-
Result of the operation.
|
|
165
|
-
"""
|
|
166
|
-
pass
|
|
167
|
-
|
|
168
|
-
# Métodos de clase
|
|
169
|
-
@classmethod
|
|
170
|
-
@abstractmethod
|
|
171
|
-
def classSyncMethod(cls, x: int, y: int) -> int:
|
|
172
|
-
"""
|
|
173
|
-
Abstract synchronous class method for integer operations.
|
|
174
|
-
|
|
175
|
-
Parameters
|
|
176
|
-
----------
|
|
177
|
-
x : int
|
|
178
|
-
First integer operand.
|
|
179
|
-
y : int
|
|
180
|
-
Second integer operand.
|
|
181
|
-
|
|
182
|
-
Returns
|
|
183
|
-
-------
|
|
184
|
-
int
|
|
185
|
-
Result of the operation.
|
|
186
|
-
"""
|
|
187
|
-
pass
|
|
188
|
-
|
|
189
|
-
@classmethod
|
|
190
|
-
@abstractmethod
|
|
191
|
-
async def classAsyncMethod(cls, x: int, y: int) -> int:
|
|
192
|
-
"""
|
|
193
|
-
Abstract asynchronous class method for integer operations.
|
|
194
|
-
|
|
195
|
-
Parameters
|
|
196
|
-
----------
|
|
197
|
-
x : int
|
|
198
|
-
First integer operand.
|
|
199
|
-
y : int
|
|
200
|
-
Second integer operand.
|
|
201
|
-
|
|
202
|
-
Returns
|
|
203
|
-
-------
|
|
204
|
-
int
|
|
205
|
-
Result of the operation.
|
|
206
|
-
"""
|
|
207
|
-
pass
|
|
208
|
-
|
|
209
|
-
@classmethod
|
|
210
|
-
@abstractmethod
|
|
211
|
-
def _classMethodProtected(cls, x: int, y: int) -> int:
|
|
212
|
-
"""
|
|
213
|
-
Abstract protected synchronous class method for integer operations.
|
|
214
|
-
|
|
215
|
-
Parameters
|
|
216
|
-
----------
|
|
217
|
-
x : int
|
|
218
|
-
First integer operand.
|
|
219
|
-
y : int
|
|
220
|
-
Second integer operand.
|
|
221
|
-
|
|
222
|
-
Returns
|
|
223
|
-
-------
|
|
224
|
-
int
|
|
225
|
-
Result of the operation.
|
|
226
|
-
"""
|
|
227
|
-
pass
|
|
228
|
-
|
|
229
|
-
@classmethod
|
|
230
|
-
@abstractmethod
|
|
231
|
-
async def _classAsyncMethodProtected(cls, x: int, y: int) -> int:
|
|
232
|
-
"""
|
|
233
|
-
Abstract protected asynchronous class method for integer operations.
|
|
234
|
-
|
|
235
|
-
Parameters
|
|
236
|
-
----------
|
|
237
|
-
x : int
|
|
238
|
-
First integer operand.
|
|
239
|
-
y : int
|
|
240
|
-
Second integer operand.
|
|
241
|
-
|
|
242
|
-
Returns
|
|
243
|
-
-------
|
|
244
|
-
int
|
|
245
|
-
Result of the operation.
|
|
246
|
-
"""
|
|
247
|
-
pass
|
|
248
|
-
|
|
249
|
-
# Métodos estáticos
|
|
250
|
-
@staticmethod
|
|
251
|
-
@abstractmethod
|
|
252
|
-
def staticMethod(text: str) -> str:
|
|
253
|
-
"""
|
|
254
|
-
Abstract static method for text processing.
|
|
255
|
-
|
|
256
|
-
Parameters
|
|
257
|
-
----------
|
|
258
|
-
text : str
|
|
259
|
-
Input text string to process.
|
|
260
|
-
|
|
261
|
-
Returns
|
|
262
|
-
-------
|
|
263
|
-
str
|
|
264
|
-
Processed text string.
|
|
265
|
-
"""
|
|
266
|
-
pass
|
|
267
|
-
|
|
268
|
-
@staticmethod
|
|
269
|
-
@abstractmethod
|
|
270
|
-
async def staticAsyncMethod(text: str) -> str:
|
|
271
|
-
"""
|
|
272
|
-
Abstract asynchronous static method for text processing.
|
|
273
|
-
|
|
274
|
-
Parameters
|
|
275
|
-
----------
|
|
276
|
-
text : str
|
|
277
|
-
Input text string to process.
|
|
278
|
-
|
|
279
|
-
Returns
|
|
280
|
-
-------
|
|
281
|
-
str
|
|
282
|
-
Processed text string.
|
|
283
|
-
"""
|
|
284
|
-
pass
|
|
285
|
-
|
|
286
|
-
@staticmethod
|
|
287
|
-
@abstractmethod
|
|
288
|
-
def _staticMethodProtected(text: str) -> str:
|
|
289
|
-
"""
|
|
290
|
-
Abstract protected static method for text processing.
|
|
291
|
-
|
|
292
|
-
Parameters
|
|
293
|
-
----------
|
|
294
|
-
text : str
|
|
295
|
-
Input text string to process.
|
|
296
|
-
|
|
297
|
-
Returns
|
|
298
|
-
-------
|
|
299
|
-
str
|
|
300
|
-
Processed text string.
|
|
301
|
-
"""
|
|
302
|
-
pass
|
|
303
|
-
|
|
304
|
-
@staticmethod
|
|
305
|
-
@abstractmethod
|
|
306
|
-
async def _staticAsyncMethodProtected(text: str) -> str:
|
|
307
|
-
"""
|
|
308
|
-
Abstract protected asynchronous static method for text processing.
|
|
309
|
-
|
|
310
|
-
Parameters
|
|
311
|
-
----------
|
|
312
|
-
text : str
|
|
313
|
-
Input text string to process.
|
|
314
|
-
|
|
315
|
-
Returns
|
|
316
|
-
-------
|
|
317
|
-
str
|
|
318
|
-
Processed text string.
|
|
319
|
-
"""
|
|
320
|
-
pass
|
|
321
|
-
|
|
322
|
-
class FakeClass(AbstractFakeClass):
|
|
323
|
-
"""
|
|
324
|
-
Concrete implementation of AbstractFakeClass for testing attribute and method visibility.
|
|
325
|
-
|
|
326
|
-
This test double class provides concrete implementations of all abstract methods
|
|
327
|
-
and properties defined in AbstractFakeClass. It demonstrates various visibility
|
|
328
|
-
levels (public, protected, private) for attributes, properties, and methods
|
|
329
|
-
including synchronous and asynchronous variants for instance, class, and static methods.
|
|
330
|
-
|
|
331
|
-
Attributes
|
|
332
|
-
----------
|
|
333
|
-
public_attr : int
|
|
334
|
-
Public attribute accessible from anywhere, default value 42.
|
|
335
|
-
dynamic_attr : Any
|
|
336
|
-
Dynamic attribute that can be set at runtime, initially None.
|
|
337
|
-
_protected_attr : str
|
|
338
|
-
Protected attribute following Python naming convention, default "protected".
|
|
339
|
-
__private_attr : str
|
|
340
|
-
Private attribute using name mangling, default "private".
|
|
341
|
-
__dd__ : str
|
|
342
|
-
Dunder attribute demonstrating double underscore usage, default "dunder_value".
|
|
343
|
-
|
|
344
|
-
Notes
|
|
345
|
-
-----
|
|
346
|
-
This class is intended for testing and inspection of Python's attribute and
|
|
347
|
-
method visibility patterns, including name mangling behavior for private members.
|
|
348
|
-
All methods perform simple operations (addition for numeric methods, uppercase
|
|
349
|
-
conversion for string methods) with optional async delays for testing purposes.
|
|
350
|
-
"""
|
|
351
|
-
|
|
352
|
-
# Class-level attribute (Public)
|
|
353
|
-
public_attr: int = 42
|
|
354
|
-
dynamic_attr = None
|
|
355
|
-
|
|
356
|
-
# Class-level attribute (Protected)
|
|
357
|
-
_protected_attr: str = "protected"
|
|
358
|
-
|
|
359
|
-
# Class-level attribute (Private)
|
|
360
|
-
__private_attr: str = "private"
|
|
361
|
-
__dd__: str = "dunder_value"
|
|
362
|
-
|
|
363
|
-
@property
|
|
364
|
-
def computed_public_property(self) -> str:
|
|
365
|
-
"""
|
|
366
|
-
Compute and return a public property value.
|
|
367
|
-
|
|
368
|
-
Returns
|
|
369
|
-
-------
|
|
370
|
-
str
|
|
371
|
-
The string "public property".
|
|
372
|
-
"""
|
|
373
|
-
return f"public property"
|
|
374
|
-
|
|
375
|
-
@property
|
|
376
|
-
def _computed_property_protected(self) -> str:
|
|
377
|
-
"""
|
|
378
|
-
Compute and return a protected property value.
|
|
379
|
-
|
|
380
|
-
Returns
|
|
381
|
-
-------
|
|
382
|
-
str
|
|
383
|
-
The string "protected property".
|
|
384
|
-
"""
|
|
385
|
-
# A computed property.
|
|
386
|
-
return f"protected property"
|
|
387
|
-
|
|
388
|
-
@property
|
|
389
|
-
def __computed_property_private(self) -> str:
|
|
390
|
-
"""
|
|
391
|
-
Compute and return a private property value.
|
|
392
|
-
|
|
393
|
-
Returns
|
|
394
|
-
-------
|
|
395
|
-
str
|
|
396
|
-
The string "private property".
|
|
397
|
-
|
|
398
|
-
Notes
|
|
399
|
-
-----
|
|
400
|
-
This is a private computed property method using name mangling,
|
|
401
|
-
typically used for internal logic or testing purposes.
|
|
402
|
-
"""
|
|
403
|
-
return f"private property"
|
|
404
|
-
|
|
405
|
-
def __init__(self, carro:ICar, *, edad:int=10, callback:ejemplo) -> None:
|
|
406
|
-
"""
|
|
407
|
-
Initialize the FakeClass instance with various attributes for testing visibility.
|
|
408
|
-
|
|
409
|
-
Parameters
|
|
410
|
-
----------
|
|
411
|
-
carro : ICar
|
|
412
|
-
Car instance dependency.
|
|
413
|
-
edad : int, default 10
|
|
414
|
-
Age parameter (keyword-only).
|
|
415
|
-
callback : callable
|
|
416
|
-
Callback function, typically the ejemplo function.
|
|
417
|
-
|
|
418
|
-
Notes
|
|
419
|
-
-----
|
|
420
|
-
Initializes attributes with different visibility levels:
|
|
421
|
-
- Public attributes: public_attr, dynamic_attr
|
|
422
|
-
- Protected attributes: _protected_attr
|
|
423
|
-
- Private attributes: __private_attr, __dd__
|
|
424
|
-
"""
|
|
425
|
-
# Initialize attributes (Publics)
|
|
426
|
-
self.public_attr = 42
|
|
427
|
-
self.dynamic_attr = None
|
|
428
|
-
|
|
429
|
-
# Initialize attributes (Protected)
|
|
430
|
-
self._protected_attr = "protected"
|
|
431
|
-
|
|
432
|
-
# Initialize attributes (Private)
|
|
433
|
-
self.__private_attr = "private"
|
|
434
|
-
self.__dd__ = "dunder_value"
|
|
435
|
-
|
|
436
|
-
def instanceSyncMethod(self, x: int, y: int) -> int:
|
|
437
|
-
"""
|
|
438
|
-
Synchronously add two integers.
|
|
439
|
-
|
|
440
|
-
Parameters
|
|
441
|
-
----------
|
|
442
|
-
x : int
|
|
443
|
-
The first integer to add.
|
|
444
|
-
y : int
|
|
445
|
-
The second integer to add.
|
|
446
|
-
|
|
447
|
-
Returns
|
|
448
|
-
-------
|
|
449
|
-
int
|
|
450
|
-
The sum of x and y.
|
|
451
|
-
"""
|
|
452
|
-
return x + y
|
|
453
|
-
|
|
454
|
-
async def instanceAsyncMethod(self, x: int, y: int) -> int:
|
|
455
|
-
"""
|
|
456
|
-
Asynchronously add two integers with a brief delay.
|
|
457
|
-
|
|
458
|
-
Parameters
|
|
459
|
-
----------
|
|
460
|
-
x : int
|
|
461
|
-
The first integer to add.
|
|
462
|
-
y : int
|
|
463
|
-
The second integer to add.
|
|
464
|
-
|
|
465
|
-
Returns
|
|
466
|
-
-------
|
|
467
|
-
int
|
|
468
|
-
The sum of x and y.
|
|
469
|
-
"""
|
|
470
|
-
await asyncio.sleep(0.1) # Brief async delay for testing
|
|
471
|
-
return x + y
|
|
472
|
-
|
|
473
|
-
def _protectedsyncMethod(self, x: int, y: int) -> int:
|
|
474
|
-
"""
|
|
475
|
-
Protected synchronous method to add two integers.
|
|
476
|
-
|
|
477
|
-
Parameters
|
|
478
|
-
----------
|
|
479
|
-
x : int
|
|
480
|
-
The first integer to add.
|
|
481
|
-
y : int
|
|
482
|
-
The second integer to add.
|
|
483
|
-
|
|
484
|
-
Returns
|
|
485
|
-
-------
|
|
486
|
-
int
|
|
487
|
-
The sum of x and y.
|
|
488
|
-
"""
|
|
489
|
-
return x + y
|
|
490
|
-
|
|
491
|
-
async def _protectedAsyncMethod(self, x: int, y: int) -> int:
|
|
492
|
-
"""
|
|
493
|
-
Protected asynchronous method to add two integers with a brief delay.
|
|
494
|
-
|
|
495
|
-
Parameters
|
|
496
|
-
----------
|
|
497
|
-
x : int
|
|
498
|
-
The first integer to add.
|
|
499
|
-
y : int
|
|
500
|
-
The second integer to add.
|
|
501
|
-
|
|
502
|
-
Returns
|
|
503
|
-
-------
|
|
504
|
-
int
|
|
505
|
-
The sum of x and y.
|
|
506
|
-
"""
|
|
507
|
-
await asyncio.sleep(0.1) # Brief async delay for testing
|
|
508
|
-
return x + y
|
|
509
|
-
|
|
510
|
-
def __privateSyncMethod(self, x: int, y: int) -> int:
|
|
511
|
-
"""
|
|
512
|
-
Private synchronous method to add two integers.
|
|
513
|
-
|
|
514
|
-
Parameters
|
|
515
|
-
----------
|
|
516
|
-
x : int
|
|
517
|
-
The first integer to add.
|
|
518
|
-
y : int
|
|
519
|
-
The second integer to add.
|
|
520
|
-
|
|
521
|
-
Returns
|
|
522
|
-
-------
|
|
523
|
-
int
|
|
524
|
-
The sum of x and y.
|
|
525
|
-
|
|
526
|
-
Notes
|
|
527
|
-
-----
|
|
528
|
-
This method uses name mangling due to the double underscore prefix.
|
|
529
|
-
"""
|
|
530
|
-
return x + y
|
|
531
|
-
|
|
532
|
-
async def __privateAsyncMethod(self, x: int, y: int) -> int:
|
|
533
|
-
"""
|
|
534
|
-
Private asynchronous method to add two integers with a brief delay.
|
|
535
|
-
|
|
536
|
-
Parameters
|
|
537
|
-
----------
|
|
538
|
-
x : int
|
|
539
|
-
The first integer to add.
|
|
540
|
-
y : int
|
|
541
|
-
The second integer to add.
|
|
542
|
-
|
|
543
|
-
Returns
|
|
544
|
-
-------
|
|
545
|
-
int
|
|
546
|
-
The sum of x and y.
|
|
547
|
-
|
|
548
|
-
Notes
|
|
549
|
-
-----
|
|
550
|
-
This method uses name mangling due to the double underscore prefix.
|
|
551
|
-
"""
|
|
552
|
-
await asyncio.sleep(0.1) # Brief async delay for testing
|
|
553
|
-
return x + y
|
|
554
|
-
|
|
555
|
-
@classmethod
|
|
556
|
-
def classSyncMethod(cls, x: int, y: int) -> int:
|
|
557
|
-
"""
|
|
558
|
-
Synchronous class method to add two integers.
|
|
559
|
-
|
|
560
|
-
Parameters
|
|
561
|
-
----------
|
|
562
|
-
x : int
|
|
563
|
-
The first integer to add.
|
|
564
|
-
y : int
|
|
565
|
-
The second integer to add.
|
|
566
|
-
|
|
567
|
-
Returns
|
|
568
|
-
-------
|
|
569
|
-
int
|
|
570
|
-
The sum of x and y.
|
|
571
|
-
"""
|
|
572
|
-
return x + y
|
|
573
|
-
|
|
574
|
-
@classmethod
|
|
575
|
-
async def classAsyncMethod(cls, x: int, y: int) -> int:
|
|
576
|
-
"""
|
|
577
|
-
Asynchronous class method to add two integers with a brief delay.
|
|
578
|
-
|
|
579
|
-
Parameters
|
|
580
|
-
----------
|
|
581
|
-
x : int
|
|
582
|
-
The first integer to add.
|
|
583
|
-
y : int
|
|
584
|
-
The second integer to add.
|
|
585
|
-
|
|
586
|
-
Returns
|
|
587
|
-
-------
|
|
588
|
-
int
|
|
589
|
-
The sum of x and y.
|
|
590
|
-
"""
|
|
591
|
-
await asyncio.sleep(0.1) # Brief async delay for testing
|
|
592
|
-
return x + y
|
|
593
|
-
|
|
594
|
-
@classmethod
|
|
595
|
-
def _classMethodProtected(cls, x: int, y: int) -> int:
|
|
596
|
-
"""
|
|
597
|
-
Protected synchronous class method to add two integers.
|
|
598
|
-
|
|
599
|
-
Parameters
|
|
600
|
-
----------
|
|
601
|
-
x : int
|
|
602
|
-
The first integer to add.
|
|
603
|
-
y : int
|
|
604
|
-
The second integer to add.
|
|
605
|
-
|
|
606
|
-
Returns
|
|
607
|
-
-------
|
|
608
|
-
int
|
|
609
|
-
The sum of x and y.
|
|
610
|
-
"""
|
|
611
|
-
return x + y
|
|
612
|
-
|
|
613
|
-
@classmethod
|
|
614
|
-
async def _classAsyncMethodProtected(cls, x: int, y: int) -> int:
|
|
615
|
-
"""
|
|
616
|
-
Protected asynchronous class method to add two integers with a brief delay.
|
|
617
|
-
|
|
618
|
-
Parameters
|
|
619
|
-
----------
|
|
620
|
-
x : int
|
|
621
|
-
The first integer to add.
|
|
622
|
-
y : int
|
|
623
|
-
The second integer to add.
|
|
624
|
-
|
|
625
|
-
Returns
|
|
626
|
-
-------
|
|
627
|
-
int
|
|
628
|
-
The sum of x and y.
|
|
629
|
-
"""
|
|
630
|
-
await asyncio.sleep(0.1) # Brief async delay for testing
|
|
631
|
-
return x + y
|
|
632
|
-
|
|
633
|
-
@classmethod
|
|
634
|
-
def __classMethodPrivate(cls, x: int, y: int) -> int:
|
|
635
|
-
"""
|
|
636
|
-
Private synchronous class method to add two integers.
|
|
637
|
-
|
|
638
|
-
Parameters
|
|
639
|
-
----------
|
|
640
|
-
x : int
|
|
641
|
-
The first integer to add.
|
|
642
|
-
y : int
|
|
643
|
-
The second integer to add.
|
|
644
|
-
|
|
645
|
-
Returns
|
|
646
|
-
-------
|
|
647
|
-
int
|
|
648
|
-
The sum of x and y.
|
|
649
|
-
|
|
650
|
-
Notes
|
|
651
|
-
-----
|
|
652
|
-
This method uses name mangling due to the double underscore prefix.
|
|
653
|
-
"""
|
|
654
|
-
return x + y
|
|
655
|
-
|
|
656
|
-
@classmethod
|
|
657
|
-
async def __classAsyncMethodPrivate(cls, x: int, y: int) -> int:
|
|
658
|
-
"""
|
|
659
|
-
Private asynchronous class method to add two integers with a brief delay.
|
|
660
|
-
|
|
661
|
-
Parameters
|
|
662
|
-
----------
|
|
663
|
-
x : int
|
|
664
|
-
The first integer to add.
|
|
665
|
-
y : int
|
|
666
|
-
The second integer to add.
|
|
667
|
-
|
|
668
|
-
Returns
|
|
669
|
-
-------
|
|
670
|
-
int
|
|
671
|
-
The sum of x and y.
|
|
672
|
-
|
|
673
|
-
Notes
|
|
674
|
-
-----
|
|
675
|
-
This method uses name mangling due to the double underscore prefix.
|
|
676
|
-
"""
|
|
677
|
-
await asyncio.sleep(0.1) # Brief async delay for testing
|
|
678
|
-
return x + y
|
|
679
|
-
|
|
680
|
-
@staticmethod
|
|
681
|
-
def staticMethod(text: str) -> str:
|
|
682
|
-
"""
|
|
683
|
-
Static method to convert text to uppercase.
|
|
684
|
-
|
|
685
|
-
Parameters
|
|
686
|
-
----------
|
|
687
|
-
text : str
|
|
688
|
-
Input text string to convert.
|
|
689
|
-
|
|
690
|
-
Returns
|
|
691
|
-
-------
|
|
692
|
-
str
|
|
693
|
-
The uppercase version of the input string.
|
|
694
|
-
"""
|
|
695
|
-
return text.upper()
|
|
696
|
-
|
|
697
|
-
@staticmethod
|
|
698
|
-
async def staticAsyncMethod(text: str) -> str:
|
|
699
|
-
"""
|
|
700
|
-
Asynchronous static method to convert text to uppercase with a brief delay.
|
|
701
|
-
|
|
702
|
-
Parameters
|
|
703
|
-
----------
|
|
704
|
-
text : str
|
|
705
|
-
Input text string to convert.
|
|
706
|
-
|
|
707
|
-
Returns
|
|
708
|
-
-------
|
|
709
|
-
str
|
|
710
|
-
The uppercase version of the input string.
|
|
711
|
-
"""
|
|
712
|
-
await asyncio.sleep(0.1) # Brief async delay for testing
|
|
713
|
-
return text.upper()
|
|
714
|
-
|
|
715
|
-
@staticmethod
|
|
716
|
-
def _staticMethodProtected(text: str) -> str:
|
|
717
|
-
"""
|
|
718
|
-
Protected static method to convert text to uppercase.
|
|
719
|
-
|
|
720
|
-
Parameters
|
|
721
|
-
----------
|
|
722
|
-
text : str
|
|
723
|
-
Input text string to convert.
|
|
724
|
-
|
|
725
|
-
Returns
|
|
726
|
-
-------
|
|
727
|
-
str
|
|
728
|
-
The uppercase version of the input string.
|
|
729
|
-
"""
|
|
730
|
-
return text.upper()
|
|
731
|
-
|
|
732
|
-
@staticmethod
|
|
733
|
-
async def _staticAsyncMethodProtected(text: str) -> str:
|
|
734
|
-
"""
|
|
735
|
-
Protected asynchronous static method to convert text to uppercase with a brief delay.
|
|
736
|
-
|
|
737
|
-
Parameters
|
|
738
|
-
----------
|
|
739
|
-
text : str
|
|
740
|
-
Input text string to convert.
|
|
741
|
-
|
|
742
|
-
Returns
|
|
743
|
-
-------
|
|
744
|
-
str
|
|
745
|
-
The uppercase version of the input string.
|
|
746
|
-
"""
|
|
747
|
-
await asyncio.sleep(0.1) # Brief async delay for testing
|
|
748
|
-
return text.upper()
|
|
749
|
-
|
|
750
|
-
@staticmethod
|
|
751
|
-
def __staticMethodPrivate(text: str) -> str:
|
|
752
|
-
"""
|
|
753
|
-
Private static method to convert text to uppercase.
|
|
754
|
-
|
|
755
|
-
Parameters
|
|
756
|
-
----------
|
|
757
|
-
text : str
|
|
758
|
-
Input text string to convert.
|
|
759
|
-
|
|
760
|
-
Returns
|
|
761
|
-
-------
|
|
762
|
-
str
|
|
763
|
-
The uppercase version of the input string.
|
|
764
|
-
|
|
765
|
-
Notes
|
|
766
|
-
-----
|
|
767
|
-
This method uses name mangling due to the double underscore prefix.
|
|
768
|
-
"""
|
|
769
|
-
return text.upper()
|
|
770
|
-
|
|
771
|
-
@staticmethod
|
|
772
|
-
async def __staticAsyncMethodPrivate(text: str) -> str:
|
|
773
|
-
"""
|
|
774
|
-
Private asynchronous static method to convert text to uppercase with a brief delay.
|
|
775
|
-
|
|
776
|
-
Parameters
|
|
777
|
-
----------
|
|
778
|
-
text : str
|
|
779
|
-
Input text string to convert.
|
|
780
|
-
|
|
781
|
-
Returns
|
|
782
|
-
-------
|
|
783
|
-
str
|
|
784
|
-
The uppercase version of the input string.
|
|
785
|
-
|
|
786
|
-
Notes
|
|
787
|
-
-----
|
|
788
|
-
This method uses name mangling due to the double underscore prefix.
|
|
789
|
-
"""
|
|
790
|
-
await asyncio.sleep(0.1) # Brief async delay for testing
|
|
791
|
-
return text.upper()
|
|
792
|
-
|