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.
Files changed (160) hide show
  1. orionis/console/base/scheduler_event_listener.py +0 -17
  2. orionis/console/contracts/schedule_event_listener.py +0 -18
  3. orionis/foundation/config/app/entities/app.py +3 -2
  4. orionis/foundation/config/app/enums/ciphers.py +5 -19
  5. orionis/foundation/config/session/entities/session.py +2 -2
  6. orionis/metadata/framework.py +1 -1
  7. orionis/services/encrypter/encrypter.py +115 -0
  8. orionis/services/environment/dynamic/caster.py +35 -27
  9. orionis/services/environment/key/key_generator.py +32 -11
  10. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/METADATA +1 -1
  11. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/RECORD +15 -159
  12. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/top_level.txt +0 -1
  13. tests/container/__init__.py +0 -0
  14. tests/container/context/__init__.py +0 -0
  15. tests/container/context/test_manager.py +0 -38
  16. tests/container/context/test_scope.py +0 -32
  17. tests/container/core/__init__.py +0 -0
  18. tests/container/core/test_advanced_async.py +0 -234
  19. tests/container/core/test_async_optimizations.py +0 -268
  20. tests/container/core/test_container.py +0 -453
  21. tests/container/core/test_singleton.py +0 -122
  22. tests/container/core/test_thread_safety.py +0 -90
  23. tests/container/entities/__init__.py +0 -0
  24. tests/container/entities/test_binding.py +0 -242
  25. tests/container/enums/__init__.py +0 -0
  26. tests/container/enums/test_lifetimes.py +0 -97
  27. tests/container/facades/__init__.py +0 -0
  28. tests/container/facades/test_facade.py +0 -78
  29. tests/container/mocks/__init__.py +0 -0
  30. tests/container/mocks/mock_advanced_async.py +0 -332
  31. tests/container/mocks/mock_async_optimizations.py +0 -407
  32. tests/container/mocks/mock_auto_resolution.py +0 -192
  33. tests/container/mocks/mock_complex_classes.py +0 -792
  34. tests/container/mocks/mock_simple_classes.py +0 -98
  35. tests/container/providers/__init__.py +0 -0
  36. tests/container/providers/test_providers.py +0 -55
  37. tests/container/validators/__init__.py +0 -0
  38. tests/container/validators/test_implements.py +0 -186
  39. tests/container/validators/test_is_abstract_class.py +0 -147
  40. tests/container/validators/test_is_callable.py +0 -102
  41. tests/container/validators/test_is_concrete_class.py +0 -160
  42. tests/container/validators/test_is_instance.py +0 -150
  43. tests/container/validators/test_is_not_subclass.py +0 -49
  44. tests/container/validators/test_is_subclass.py +0 -178
  45. tests/container/validators/test_is_valid_alias.py +0 -147
  46. tests/container/validators/test_lifetime.py +0 -106
  47. tests/example/__init__.py +0 -0
  48. tests/example/test_example.py +0 -725
  49. tests/foundation/__init__.py +0 -0
  50. tests/foundation/config/__init__.py +0 -0
  51. tests/foundation/config/app/__init__.py +0 -0
  52. tests/foundation/config/app/test_foundation_config_app.py +0 -262
  53. tests/foundation/config/auth/__init__.py +0 -0
  54. tests/foundation/config/auth/test_foundation_config_auth.py +0 -29
  55. tests/foundation/config/cache/__init__.py +0 -0
  56. tests/foundation/config/cache/test_foundation_config_cache.py +0 -143
  57. tests/foundation/config/cache/test_foundation_config_cache_file.py +0 -126
  58. tests/foundation/config/cache/test_foundation_config_cache_stores.py +0 -156
  59. tests/foundation/config/cors/__init__.py +0 -0
  60. tests/foundation/config/cors/test_foundation_config_cors.py +0 -190
  61. tests/foundation/config/database/__init__.py +0 -0
  62. tests/foundation/config/database/test_foundation_config_database.py +0 -158
  63. tests/foundation/config/database/test_foundation_config_database_connections.py +0 -203
  64. tests/foundation/config/database/test_foundation_config_database_mysql.py +0 -354
  65. tests/foundation/config/database/test_foundation_config_database_oracle.py +0 -288
  66. tests/foundation/config/database/test_foundation_config_database_pgsql.py +0 -257
  67. tests/foundation/config/database/test_foundation_config_database_sqlite.py +0 -207
  68. tests/foundation/config/filesystems/__init__.py +0 -0
  69. tests/foundation/config/filesystems/test_foundation_config_filesystems.py +0 -160
  70. tests/foundation/config/filesystems/test_foundation_config_filesystems_aws.py +0 -189
  71. tests/foundation/config/filesystems/test_foundation_config_filesystems_disks.py +0 -184
  72. tests/foundation/config/filesystems/test_foundation_config_filesystems_local.py +0 -143
  73. tests/foundation/config/filesystems/test_foundation_config_filesystems_public.py +0 -184
  74. tests/foundation/config/logging/__init__.py +0 -0
  75. tests/foundation/config/logging/test_foundation_config_logging.py +0 -112
  76. tests/foundation/config/logging/test_foundation_config_logging_channels.py +0 -246
  77. tests/foundation/config/logging/test_foundation_config_logging_chunked.py +0 -217
  78. tests/foundation/config/logging/test_foundation_config_logging_daily.py +0 -220
  79. tests/foundation/config/logging/test_foundation_config_logging_hourly.py +0 -196
  80. tests/foundation/config/logging/test_foundation_config_logging_monthly.py +0 -214
  81. tests/foundation/config/logging/test_foundation_config_logging_stack.py +0 -178
  82. tests/foundation/config/logging/test_foundation_config_logging_weekly.py +0 -224
  83. tests/foundation/config/mail/__init__.py +0 -0
  84. tests/foundation/config/mail/test_foundation_config_mail.py +0 -145
  85. tests/foundation/config/mail/test_foundation_config_mail_file.py +0 -97
  86. tests/foundation/config/mail/test_foundation_config_mail_mailers.py +0 -106
  87. tests/foundation/config/mail/test_foundation_config_mail_smtp.py +0 -146
  88. tests/foundation/config/queue/__init__.py +0 -0
  89. tests/foundation/config/queue/test_foundation_config_queue.py +0 -88
  90. tests/foundation/config/queue/test_foundation_config_queue_brokers.py +0 -72
  91. tests/foundation/config/queue/test_foundation_config_queue_database.py +0 -134
  92. tests/foundation/config/root/__init__.py +0 -0
  93. tests/foundation/config/root/test_foundation_config_root_paths.py +0 -112
  94. tests/foundation/config/session/__init__.py +0 -0
  95. tests/foundation/config/session/test_foundation_config_session.py +0 -213
  96. tests/foundation/config/startup/__init__.py +0 -0
  97. tests/foundation/config/startup/test_foundation_config_startup.py +0 -202
  98. tests/foundation/config/testing/__init__.py +0 -0
  99. tests/foundation/config/testing/test_foundation_config_testing.py +0 -235
  100. tests/metadata/__init__.py +0 -0
  101. tests/metadata/test_metadata_framework.py +0 -140
  102. tests/metadata/test_metadata_package.py +0 -139
  103. tests/services/__init__.py +0 -0
  104. tests/services/asynchrony/__init__.py +0 -0
  105. tests/services/asynchrony/test_services_asynchrony_coroutine.py +0 -85
  106. tests/services/environment/__init__.py +0 -0
  107. tests/services/environment/test_services_environment.py +0 -226
  108. tests/services/introspection/__init__.py +0 -0
  109. tests/services/introspection/dependencies/__init__.py +0 -0
  110. tests/services/introspection/dependencies/mocks/__init__.py +0 -0
  111. tests/services/introspection/dependencies/mocks/mock_user.py +0 -30
  112. tests/services/introspection/dependencies/mocks/mock_user_controller.py +0 -27
  113. tests/services/introspection/dependencies/mocks/mock_users_permissions.py +0 -41
  114. tests/services/introspection/dependencies/test_reflect_dependencies.py +0 -261
  115. tests/services/introspection/reflection/__init__.py +0 -0
  116. tests/services/introspection/reflection/mock/__init__.py +0 -0
  117. tests/services/introspection/reflection/mock/fake_reflect_instance.py +0 -1115
  118. tests/services/introspection/reflection/test_reflection_abstract.py +0 -1011
  119. tests/services/introspection/reflection/test_reflection_callable.py +0 -206
  120. tests/services/introspection/reflection/test_reflection_concrete.py +0 -952
  121. tests/services/introspection/reflection/test_reflection_instance.py +0 -1233
  122. tests/services/introspection/reflection/test_reflection_module.py +0 -567
  123. tests/services/introspection/test_reflection.py +0 -462
  124. tests/services/log/__init__.py +0 -0
  125. tests/services/log/test_log.py +0 -97
  126. tests/services/system/__init__.py +0 -0
  127. tests/services/system/test_services_system_imports.py +0 -204
  128. tests/services/system/test_services_system_workers.py +0 -131
  129. tests/support/__init__.py +0 -0
  130. tests/support/entities/__init__.py +0 -0
  131. tests/support/entities/mock_dataclass.py +0 -40
  132. tests/support/entities/test_base.py +0 -64
  133. tests/support/patterns/__init__.py +0 -0
  134. tests/support/patterns/singleton/__init__.py +0 -0
  135. tests/support/patterns/singleton/test_patterns_singleton.py +0 -39
  136. tests/support/standard/__init__.py +0 -0
  137. tests/support/standard/test_services_std.py +0 -226
  138. tests/support/wrapper/__init__.py +0 -0
  139. tests/support/wrapper/test_services_wrapper_docdict.py +0 -202
  140. tests/testing/__init__.py +0 -0
  141. tests/testing/cases/__init__.py +0 -0
  142. tests/testing/cases/test_testing_asynchronous.py +0 -63
  143. tests/testing/cases/test_testing_synchronous.py +0 -57
  144. tests/testing/entities/__init__.py +0 -0
  145. tests/testing/entities/test_testing_result.py +0 -146
  146. tests/testing/enums/__init__.py +0 -0
  147. tests/testing/enums/test_testing_status.py +0 -63
  148. tests/testing/output/__init__.py +0 -0
  149. tests/testing/output/test_testing_dumper.py +0 -29
  150. tests/testing/output/test_testing_printer.py +0 -42
  151. tests/testing/records/__init__.py +0 -0
  152. tests/testing/records/test_testing_records.py +0 -171
  153. tests/testing/test_testing_unit.py +0 -164
  154. tests/testing/validators/__init__.py +0 -0
  155. tests/testing/validators/test_testing_validators.py +0 -392
  156. tests/testing/view/__init__.py +0 -0
  157. tests/testing/view/test_render.py +0 -30
  158. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/WHEEL +0 -0
  159. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/licenses/LICENCE +0 -0
  160. {orionis-0.546.0.dist-info → orionis-0.547.0.dist-info}/zip-safe +0 -0
@@ -1,462 +0,0 @@
1
- from orionis.services.introspection.reflection import Reflection
2
- from orionis.test.cases.asynchronous import AsyncTestCase
3
- import sys
4
- import inspect
5
- import abc
6
-
7
- class TestServiceReflectionAbstract(AsyncTestCase):
8
-
9
- async def testIsAbstract(self):
10
- """
11
- Test Reflection.isAbstract for abstract and concrete classes.
12
-
13
- Parameters
14
- ----------
15
- None
16
-
17
- Tests
18
- -----
19
- - DummyAbstract: An abstract class using abc.ABCMeta with an abstract method.
20
- - DummyConcrete: A regular concrete class.
21
-
22
- Returns
23
- -------
24
- None
25
-
26
- Asserts
27
- -------
28
- - Reflection.isAbstract(DummyAbstract) returns True.
29
- - Reflection.isAbstract(DummyConcrete) returns False.
30
- """
31
- class DummyAbstract(metaclass=abc.ABCMeta):
32
- @abc.abstractmethod
33
- def foo(self):
34
- pass
35
-
36
- class DummyConcrete:
37
- def bar(self):
38
- return 42
39
-
40
- self.assertTrue(Reflection.isAbstract(DummyAbstract))
41
- self.assertFalse(Reflection.isAbstract(DummyConcrete))
42
-
43
- async def testIsAsyncGen(self):
44
- """
45
- Test Reflection.isAsyncGen for correct identification of asynchronous generators.
46
-
47
- Notes
48
- -----
49
- - The asynchronous generator is defined using `async def` and `yield`.
50
- - The regular generator is defined using `def` and `yield`.
51
-
52
- Returns
53
- -------
54
- None
55
-
56
- Asserts
57
- -------
58
- - Reflection.isAsyncGen(agen) is True.
59
- - Reflection.isAsyncGen(dummy_generator()) is False.
60
- """
61
- async def dummy_asyncgen():
62
- yield 1
63
-
64
- def dummy_generator():
65
- yield 1
66
-
67
- agen = dummy_asyncgen()
68
- self.assertTrue(Reflection.isAsyncGen(agen))
69
- self.assertFalse(Reflection.isAsyncGen(dummy_generator()))
70
-
71
- async def testIsAsyncGenFunction(self):
72
- """
73
- Test Reflection.isAsyncGenFunction for correct identification of async generator functions.
74
-
75
- Returns
76
- -------
77
- None
78
-
79
- Asserts
80
- -------
81
- - Reflection.isAsyncGenFunction(dummy_asyncgen) returns True.
82
- - Reflection.isAsyncGenFunction(dummy_generator) returns False.
83
- """
84
- async def dummy_asyncgen():
85
- yield 1
86
-
87
- def dummy_generator():
88
- yield 1
89
-
90
- self.assertTrue(Reflection.isAsyncGenFunction(dummy_asyncgen))
91
- self.assertFalse(Reflection.isAsyncGenFunction(dummy_generator))
92
-
93
- async def testIsAwaitable(self):
94
- """
95
- Test Reflection.isAwaitable to verify correct identification of awaitable objects.
96
-
97
- Returns
98
- -------
99
- None
100
-
101
- Asserts
102
- -------
103
- - An async coroutine object is recognized as awaitable.
104
- - A non-awaitable object (e.g., an integer) is not recognized as awaitable.
105
- """
106
- async def dummy_coroutine():
107
- pass
108
-
109
- coro = dummy_coroutine()
110
- self.assertTrue(Reflection.isAwaitable(coro))
111
- self.assertFalse(Reflection.isAwaitable(42))
112
-
113
- async def testIsBuiltin(self):
114
- """
115
- Test Reflection.isBuiltin to verify correct identification of built-in functions.
116
-
117
- Returns
118
- -------
119
- None
120
-
121
- Asserts
122
- -------
123
- - The built-in function `len` is recognized as built-in.
124
- - A user-defined function is not recognized as built-in.
125
- """
126
- def dummy_function():
127
- pass
128
-
129
- self.assertTrue(Reflection.isBuiltin(len))
130
- self.assertFalse(Reflection.isBuiltin(dummy_function))
131
-
132
- async def testIsClass(self):
133
- """
134
- Test Reflection.isClass to verify correct identification of classes and non-class objects.
135
-
136
- Returns
137
- -------
138
- None
139
-
140
- Asserts
141
- -------
142
- - Reflection.isClass returns True for a class.
143
- - Reflection.isClass returns False for a function.
144
- """
145
- class DummyConcrete:
146
- def bar(self):
147
- return 42
148
-
149
- def dummy_function():
150
- pass
151
-
152
- self.assertTrue(Reflection.isClass(DummyConcrete))
153
- self.assertFalse(Reflection.isClass(dummy_function))
154
-
155
- async def testIsCode(self):
156
- """
157
- Test Reflection.isCode to verify correct identification of code objects.
158
-
159
- Returns
160
- -------
161
- None
162
-
163
- Asserts
164
- -------
165
- - Passing a function's __code__ attribute returns True.
166
- - Passing the function itself returns False.
167
- """
168
- def dummy_function():
169
- pass
170
-
171
- self.assertTrue(Reflection.isCode(dummy_function.__code__))
172
- self.assertFalse(Reflection.isCode(dummy_function))
173
-
174
- async def testIsCoroutine(self):
175
- """
176
- Test Reflection.isCoroutine to ensure correct identification of coroutine objects.
177
-
178
- Returns
179
- -------
180
- None
181
-
182
- Asserts
183
- -------
184
- - Reflection.isCoroutine returns True for a coroutine object.
185
- - Reflection.isCoroutine returns False for a regular function.
186
- """
187
- async def dummy_coroutine():
188
- pass
189
-
190
- def dummy_function():
191
- pass
192
-
193
- coro = dummy_coroutine()
194
- self.assertTrue(Reflection.isCoroutine(coro))
195
- self.assertFalse(Reflection.isCoroutine(dummy_function))
196
-
197
- async def testIsCoroutineFunction(self):
198
- """
199
- Test Reflection.isCoroutineFunction to verify correct identification of coroutine functions.
200
-
201
- Returns
202
- -------
203
- None
204
-
205
- Asserts
206
- -------
207
- - Reflection.isCoroutineFunction(dummy_coroutine) returns True.
208
- - Reflection.isCoroutineFunction(dummy_function) returns False.
209
- """
210
- async def dummy_coroutine():
211
- pass
212
-
213
- def dummy_function():
214
- pass
215
-
216
- self.assertTrue(Reflection.isCoroutineFunction(dummy_coroutine))
217
- self.assertFalse(Reflection.isCoroutineFunction(dummy_function))
218
-
219
- async def testIsDataDescriptor(self):
220
- """
221
- Test Reflection.isDataDescriptor to verify correct identification of data descriptors.
222
-
223
- Returns
224
- -------
225
- None
226
-
227
- Asserts
228
- -------
229
- - A property object is recognized as a data descriptor.
230
- - A non-descriptor object (such as an integer) is not.
231
- """
232
- class X:
233
- @property
234
- def foo(self): return 1
235
-
236
- self.assertTrue(Reflection.isDataDescriptor(X.__dict__['foo']))
237
- self.assertFalse(Reflection.isDataDescriptor(42))
238
-
239
- async def testIsFrame(self):
240
- """
241
- Test Reflection.isFrame to verify correct identification of frame objects.
242
-
243
- Returns
244
- -------
245
- None
246
-
247
- Asserts
248
- -------
249
- - Reflection.isFrame returns True for a valid frame object.
250
- - Reflection.isFrame returns False for a non-frame object.
251
- """
252
- frame = inspect.currentframe()
253
- self.assertTrue(Reflection.isFrame(frame))
254
- self.assertFalse(Reflection.isFrame(42))
255
-
256
- async def testIsFunction(self):
257
- """
258
- Test Reflection.isFunction to verify correct identification of functions.
259
-
260
- Returns
261
- -------
262
- None
263
-
264
- Asserts
265
- -------
266
- - A standalone function is correctly identified as a function.
267
- - An unbound method is not identified as a function.
268
- """
269
- def dummy_function():
270
- pass
271
-
272
- class DummyConcrete:
273
- def bar(self):
274
- return 42
275
-
276
- self.assertTrue(Reflection.isFunction(dummy_function))
277
- # Unbound methods in Python 3 are just functions, so this should be True
278
- self.assertTrue(Reflection.isFunction(DummyConcrete.bar))
279
-
280
- async def testIsGenerator(self):
281
- """
282
- Test Reflection.isGenerator to verify correct identification of generator objects.
283
-
284
- Returns
285
- -------
286
- None
287
-
288
- Asserts
289
- -------
290
- - Reflection.isGenerator returns True for a generator object.
291
- - Reflection.isGenerator returns False for a regular function.
292
- """
293
- def dummy_generator():
294
- yield 1
295
-
296
- def dummy_function():
297
- pass
298
-
299
- gen = dummy_generator()
300
- self.assertTrue(Reflection.isGenerator(gen))
301
- self.assertFalse(Reflection.isGenerator(dummy_function))
302
-
303
- async def testIsGeneratorFunction(self):
304
- """
305
- Test Reflection.isGeneratorFunction to verify correct identification of generator functions.
306
-
307
- Returns
308
- -------
309
- None
310
-
311
- Asserts
312
- -------
313
- - Reflection.isGeneratorFunction(dummy_generator) returns True.
314
- - Reflection.isGeneratorFunction(dummy_function) returns False.
315
- """
316
- def dummy_generator():
317
- yield 1
318
-
319
- def dummy_function():
320
- pass
321
-
322
- self.assertTrue(Reflection.isGeneratorFunction(dummy_generator))
323
- self.assertFalse(Reflection.isGeneratorFunction(dummy_function))
324
-
325
- async def testIsGetSetDescriptor(self):
326
- """
327
- Test Reflection.isGetSetDescriptor to verify correct identification of get-set descriptors.
328
-
329
- Returns
330
- -------
331
- None
332
-
333
- Asserts
334
- -------
335
- - Reflection.isGetSetDescriptor returns True for a known get-set descriptor.
336
- - Reflection.isGetSetDescriptor returns False for a non-descriptor object.
337
- """
338
- self.assertTrue(Reflection.isGetSetDescriptor(type.__dict__['__dict__']))
339
- self.assertFalse(Reflection.isGetSetDescriptor(42))
340
-
341
- async def testIsMemberDescriptor(self):
342
- """
343
- Test Reflection.isMemberDescriptor to verify correct identification of member descriptors.
344
-
345
- Returns
346
- -------
347
- None
348
-
349
- Asserts
350
- -------
351
- - type.__dict__['__weakref__'] is recognized as a member descriptor.
352
- - An integer is not recognized as a member descriptor.
353
- """
354
- # Use an alternative member descriptor: use a slot from a new-style class
355
- class Y:
356
- __slots__ = ('foo',)
357
- self.assertTrue(Reflection.isMemberDescriptor(Y.__dict__['foo']))
358
- self.assertFalse(Reflection.isMemberDescriptor(42))
359
- self.assertFalse(Reflection.isMemberDescriptor(42))
360
-
361
- async def testIsMethod(self):
362
- """
363
- Test Reflection.isMethod to verify correct identification of methods.
364
-
365
- Returns
366
- -------
367
- None
368
-
369
- Asserts
370
- -------
371
- - Reflection.isMethod returns True for a class method.
372
- - Reflection.isMethod returns False for a standalone function.
373
- """
374
- class DummyConcrete:
375
- def bar(self):
376
- return 42
377
-
378
- obj = DummyConcrete()
379
- def dummy_function():
380
- pass
381
-
382
- self.assertTrue(Reflection.isMethod(obj.bar))
383
- self.assertFalse(Reflection.isMethod(dummy_function))
384
-
385
- async def testIsMethodDescriptor(self):
386
- """
387
- Test Reflection.isMethodDescriptor to verify correct identification of method descriptors.
388
-
389
- Returns
390
- -------
391
- None
392
-
393
- Asserts
394
- -------
395
- - Reflection.isMethodDescriptor(str.upper) returns True.
396
- - Reflection.isMethodDescriptor(dummy_function) returns False.
397
- """
398
- def dummy_function():
399
- pass
400
-
401
- self.assertTrue(Reflection.isMethodDescriptor(str.upper))
402
- self.assertFalse(Reflection.isMethodDescriptor(dummy_function))
403
-
404
- async def testIsModule(self):
405
- """
406
- Test Reflection.isModule to verify correct identification of module objects.
407
-
408
- Returns
409
- -------
410
- None
411
-
412
- Asserts
413
- -------
414
- - Reflection.isModule returns True for a module (e.g., sys).
415
- - Reflection.isModule returns False for a non-module (e.g., a function).
416
- """
417
- def dummy_function():
418
- pass
419
-
420
- self.assertTrue(Reflection.isModule(sys))
421
- self.assertFalse(Reflection.isModule(dummy_function))
422
-
423
- async def testIsRoutine(self):
424
- """
425
- Test Reflection.isRoutine to verify correct identification of routine objects.
426
-
427
- Returns
428
- -------
429
- None
430
-
431
- Asserts
432
- -------
433
- - A user-defined function is recognized as a routine.
434
- - A built-in function is recognized as a routine.
435
- - A non-routine object is not recognized as a routine.
436
- """
437
- def dummy_function():
438
- pass
439
-
440
- self.assertTrue(Reflection.isRoutine(dummy_function))
441
- self.assertTrue(Reflection.isRoutine(len))
442
- self.assertFalse(Reflection.isRoutine(42))
443
-
444
- async def testIsTraceback(self):
445
- """
446
- Test Reflection.isTraceback to verify correct identification of traceback objects.
447
-
448
- Returns
449
- -------
450
- None
451
-
452
- Asserts
453
- -------
454
- - Reflection.isTraceback returns True for a traceback object.
455
- - Reflection.isTraceback returns False for a non-traceback object.
456
- """
457
- try:
458
- raise Exception("test")
459
- except Exception:
460
- tb = sys.exc_info()[2]
461
- self.assertTrue(Reflection.isTraceback(tb))
462
- self.assertFalse(Reflection.isTraceback(42))
File without changes
@@ -1,97 +0,0 @@
1
- from orionis.services.log.log_service import Logger
2
- from orionis.support.facades.logger import Log
3
- from orionis.test.cases.asynchronous import AsyncTestCase
4
-
5
- class TestLogger(AsyncTestCase):
6
-
7
- async def testHasInfoMethod(self):
8
- """
9
- Checks if the Logger class has an 'info' method.
10
-
11
- Returns
12
- -------
13
- None
14
- This test passes if the 'info' method exists, otherwise it fails.
15
- """
16
- self.assertTrue(hasattr(Logger, "info"))
17
-
18
- async def testHasErrorMethod(self):
19
- """
20
- Checks if the Logger class has an 'error' method.
21
-
22
- Returns
23
- -------
24
- None
25
- This test passes if the 'error' method exists, otherwise it fails.
26
- """
27
- self.assertTrue(hasattr(Logger, "error"))
28
-
29
- async def testHasWarningMethod(self):
30
- """
31
- Checks if the Logger class has a 'warning' method.
32
-
33
- Returns
34
- -------
35
- None
36
- This test passes if the 'warning' method exists, otherwise it fails.
37
- """
38
- self.assertTrue(hasattr(Logger, "warning"))
39
-
40
- async def testHasDebugMethod(self):
41
- """
42
- Checks if the Logger class has a 'debug' method.
43
-
44
- Returns
45
- -------
46
- None
47
- This test passes if the 'debug' method exists, otherwise it fails.
48
- """
49
- self.assertTrue(hasattr(Logger, "debug"))
50
-
51
- async def testLoggerWritesInfo(self):
52
- """
53
- Tests that the logger writes an info-level message.
54
-
55
- Returns
56
- -------
57
- None
58
- This test passes if the info message is processed without error.
59
- """
60
- # Log an info message
61
- Log.info("Mensaje de prueba info")
62
-
63
- async def testLoggerWritesError(self):
64
- """
65
- Tests that the logger writes an error-level message.
66
-
67
- Returns
68
- -------
69
- None
70
- This test passes if the error message is processed without error.
71
- """
72
- # Log an error message
73
- Log.error("Mensaje de prueba error")
74
-
75
- async def testLoggerWritesWarning(self):
76
- """
77
- Tests that the logger writes a warning-level message.
78
-
79
- Returns
80
- -------
81
- None
82
- This test passes if the warning message is processed without error.
83
- """
84
- # Log a warning message
85
- Log.warning("Mensaje de prueba warning")
86
-
87
- async def testLoggerWritesDebug(self):
88
- """
89
- Tests that the logger writes a debug-level message.
90
-
91
- Returns
92
- -------
93
- None
94
- This test passes if the debug message is processed without error.
95
- """
96
- # Log a debug message
97
- Log.debug("Mensaje de prueba debug")
File without changes