orionis 0.218.0__py3-none-any.whl → 0.219.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/framework.py +1 -1
- orionis/luminate/application.py +1 -1
- orionis/luminate/container/resolve.py +1 -1
- orionis/luminate/contracts/facades/facade.py +1 -1
- orionis/luminate/support/adapters/__init__.py +0 -0
- orionis/luminate/support/async_io/__init__.py +0 -0
- orionis/luminate/support/async_io/async_coroutine.py +48 -0
- orionis/luminate/support/async_io/contracts/async_coroutine.py +31 -0
- orionis/luminate/support/standard/std.py +0 -9
- orionis/luminate/test/contracts/__init__.py +0 -0
- orionis/luminate/test/contracts/test_std_out.py +17 -0
- orionis/luminate/test/contracts/test_suite.py +37 -0
- orionis/luminate/test/contracts/test_unit.py +82 -0
- orionis/luminate/test/test_std_out.py +2 -1
- orionis/luminate/test/test_suite.py +2 -1
- orionis/luminate/test/test_unit.py +2 -1
- {orionis-0.218.0.dist-info → orionis-0.219.0.dist-info}/METADATA +1 -1
- {orionis-0.218.0.dist-info → orionis-0.219.0.dist-info}/RECORD +29 -16
- tests/support/adapters/__init__.py +0 -0
- tests/support/adapters/fakes/__init__.py +0 -0
- tests/support/adapters/fakes/fake_dict.py +15 -0
- tests/support/adapters/test_doct_dict.py +21 -0
- tests/support/async_io/__init__.py +0 -0
- tests/support/async_io/test_async_coroutine.py +35 -0
- orionis/luminate/support/asyn_run.py +0 -41
- /orionis/luminate/support/{dot_dict.py → adapters/dot_dict.py} +0 -0
- {orionis-0.218.0.dist-info → orionis-0.219.0.dist-info}/LICENCE +0 -0
- {orionis-0.218.0.dist-info → orionis-0.219.0.dist-info}/WHEEL +0 -0
- {orionis-0.218.0.dist-info → orionis-0.219.0.dist-info}/entry_points.txt +0 -0
- {orionis-0.218.0.dist-info → orionis-0.219.0.dist-info}/top_level.txt +0 -0
orionis/framework.py
CHANGED
orionis/luminate/application.py
CHANGED
@@ -10,7 +10,7 @@ from orionis.luminate.foundation.environment.environment_bootstrapper import Env
|
|
10
10
|
from orionis.luminate.foundation.exceptions.exception_bootstrapper import BootstrapRuntimeError
|
11
11
|
from orionis.luminate.foundation.providers.service_providers_bootstrapper import ServiceProvidersBootstrapper
|
12
12
|
from orionis.luminate.patterns.singleton import SingletonMeta
|
13
|
-
from orionis.luminate.support.
|
13
|
+
from orionis.luminate.support.async_io.async_coroutine import AsyncExecutor
|
14
14
|
|
15
15
|
class Application(metaclass=SingletonMeta):
|
16
16
|
"""
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from typing import Any, Callable
|
2
2
|
from orionis.luminate.container.container import Container
|
3
3
|
from orionis.luminate.container.exception import OrionisContainerValueError
|
4
|
-
from orionis.luminate.support.
|
4
|
+
from orionis.luminate.support.async_io.async_coroutine import AsyncExecutor
|
5
5
|
|
6
6
|
class Resolve:
|
7
7
|
"""
|
File without changes
|
File without changes
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import asyncio
|
2
|
+
from inspect import iscoroutine
|
3
|
+
from typing import Any, Coroutine, TypeVar, Union
|
4
|
+
from orionis.luminate.support.async_io.contracts.async_coroutine import IAsyncCoroutine
|
5
|
+
|
6
|
+
T = TypeVar("T")
|
7
|
+
|
8
|
+
class AsyncCoroutine(IAsyncCoroutine):
|
9
|
+
"""
|
10
|
+
A utility class for executing coroutine objects in various asynchronous and synchronous contexts.
|
11
|
+
This class provides a static method to execute coroutine objects, handling different scenarios
|
12
|
+
such as running within an active event loop (e.g., in Jupyter notebooks or Starlette) or in a
|
13
|
+
synchronous context without an active event loop.
|
14
|
+
|
15
|
+
Methods
|
16
|
+
-------
|
17
|
+
execute(coro: Coroutine[Any, Any, T]) -> Union[T, asyncio.Future]
|
18
|
+
Executes the given coroutine object, adapting to the current execution context.
|
19
|
+
"""
|
20
|
+
|
21
|
+
@staticmethod
|
22
|
+
def execute(coro: Coroutine[Any, Any, T]) -> Union[T, asyncio.Future]:
|
23
|
+
"""
|
24
|
+
Executes the given coroutine object, adapting to the current execution context.
|
25
|
+
If there is an active event loop, it uses `asyncio.ensure_future` to schedule the coroutine.
|
26
|
+
If there is no active event loop, it uses `asyncio.run` to run the coroutine directly.
|
27
|
+
If the coroutine is already running, it returns a `Future` object that can be awaited.
|
28
|
+
|
29
|
+
Parameters
|
30
|
+
----------
|
31
|
+
coro : Coroutine[Any, Any, T]
|
32
|
+
The coroutine object
|
33
|
+
"""
|
34
|
+
if not iscoroutine(coro):
|
35
|
+
raise TypeError("Expected a coroutine object.")
|
36
|
+
|
37
|
+
try:
|
38
|
+
loop = asyncio.get_running_loop()
|
39
|
+
except RuntimeError:
|
40
|
+
# No hay loop activo: ejecutamos directamente
|
41
|
+
return asyncio.run(coro)
|
42
|
+
|
43
|
+
if loop.is_running():
|
44
|
+
# Ya hay un loop activo (notebooks, FastAPI, etc.)
|
45
|
+
return asyncio.ensure_future(coro) # devuelve un Future (debes await si estás en async)
|
46
|
+
else:
|
47
|
+
# Estamos en código síncrono, pero con acceso al loop
|
48
|
+
return loop.run_until_complete(coro)
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import asyncio
|
2
|
+
from typing import Any, Coroutine, TypeVar, Union
|
3
|
+
|
4
|
+
T = TypeVar("T")
|
5
|
+
|
6
|
+
class IAsyncCoroutine:
|
7
|
+
"""
|
8
|
+
Interface for executing asynchronous coroutines.
|
9
|
+
|
10
|
+
Methods
|
11
|
+
-------
|
12
|
+
execute(coro: Coroutine[Any, Any, T]) -> Union[T, asyncio.Future]
|
13
|
+
Executes the given coroutine.
|
14
|
+
"""
|
15
|
+
|
16
|
+
@staticmethod
|
17
|
+
def execute(coro: Coroutine[Any, Any, T]) -> Union[T, asyncio.Future]:
|
18
|
+
"""
|
19
|
+
Execute the given coroutine.
|
20
|
+
|
21
|
+
Parameters
|
22
|
+
----------
|
23
|
+
coro : Coroutine[Any, Any, T]
|
24
|
+
The coroutine to be executed.
|
25
|
+
|
26
|
+
Returns
|
27
|
+
-------
|
28
|
+
Union[T, asyncio.Future]
|
29
|
+
The result of the coroutine execution or a Future object.
|
30
|
+
"""
|
31
|
+
pass
|
@@ -4,15 +4,6 @@ class StdClass(IStdClass):
|
|
4
4
|
"""
|
5
5
|
A dynamic class that allows setting arbitrary attributes,
|
6
6
|
similar to PHP's stdClass.
|
7
|
-
|
8
|
-
Examples
|
9
|
-
--------
|
10
|
-
>>> obj = StdClass(name='Raul', age=30)
|
11
|
-
>>> obj.name
|
12
|
-
'Raul'
|
13
|
-
>>> obj.update(age=31)
|
14
|
-
>>> obj.toDict()
|
15
|
-
{'name': 'Raul', 'age': 31}
|
16
7
|
"""
|
17
8
|
|
18
9
|
def __init__(self, **kwargs):
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
from typing import Any
|
2
|
+
|
3
|
+
class ITestStdOut:
|
4
|
+
"""
|
5
|
+
Utility for printing debug info during tests, including caller context (file, line, method).
|
6
|
+
"""
|
7
|
+
|
8
|
+
@staticmethod
|
9
|
+
def print(*args: Any) -> None:
|
10
|
+
"""
|
11
|
+
Print arguments to the console with file, line, and method of the caller.
|
12
|
+
|
13
|
+
Parameters
|
14
|
+
----------
|
15
|
+
*args : Any
|
16
|
+
Any values to print. The first argument is ignored (typically the class or context).
|
17
|
+
"""
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class ITests:
|
2
|
+
"""
|
3
|
+
Provides utility methods to configure and execute unit tests from specified folders.
|
4
|
+
"""
|
5
|
+
|
6
|
+
@staticmethod
|
7
|
+
def execute(folders: list, print_result:bool = True, throw_exception:bool = False):
|
8
|
+
"""
|
9
|
+
Configure and run unit tests from a list of folder definitions.
|
10
|
+
|
11
|
+
Parameters
|
12
|
+
----------
|
13
|
+
folders : list of dict
|
14
|
+
Each dict must include:
|
15
|
+
- 'folder_path' (str): Path to the folder with test files.
|
16
|
+
- 'base_path' (str): Base path for resolving test imports.
|
17
|
+
- 'pattern' (str): Glob pattern for test file names.
|
18
|
+
|
19
|
+
print_result : bool, default=True
|
20
|
+
Whether to print test results to the console.
|
21
|
+
|
22
|
+
throw_exception : bool, default=False
|
23
|
+
Whether to raise exceptions on test failures.
|
24
|
+
|
25
|
+
Returns
|
26
|
+
-------
|
27
|
+
UnitTestClass
|
28
|
+
The initialized and executed test suite.
|
29
|
+
|
30
|
+
Raises
|
31
|
+
------
|
32
|
+
TypeError
|
33
|
+
If `folders` is not a list of dictionaries.
|
34
|
+
KeyError
|
35
|
+
If any dictionary lacks required keys: 'folder_path', 'base_path', or 'pattern'.
|
36
|
+
"""
|
37
|
+
pass
|
@@ -0,0 +1,82 @@
|
|
1
|
+
from typing import Any, Dict, Optional
|
2
|
+
|
3
|
+
class IUnitTest:
|
4
|
+
"""
|
5
|
+
Advanced unit testing utility for discovering, executing, and reporting test results
|
6
|
+
with support for folder-based discovery, regex filtering, and customizable output.
|
7
|
+
|
8
|
+
Attributes
|
9
|
+
----------
|
10
|
+
loader : unittest.TestLoader
|
11
|
+
Internal loader for test discovery.
|
12
|
+
suite : unittest.TestSuite
|
13
|
+
The aggregated test suite to be executed.
|
14
|
+
test_results : List[TestResult]
|
15
|
+
List of captured results per test, including status and errors.
|
16
|
+
start_time : float
|
17
|
+
Timestamp when the test execution started.
|
18
|
+
"""
|
19
|
+
|
20
|
+
def addFolder(
|
21
|
+
self,
|
22
|
+
folder_path: str,
|
23
|
+
base_path: str = "tests",
|
24
|
+
pattern: str = "test_*.py",
|
25
|
+
test_name_pattern: Optional[str] = None
|
26
|
+
):
|
27
|
+
"""
|
28
|
+
Discover and add test cases from a given folder to the test suite.
|
29
|
+
|
30
|
+
Parameters
|
31
|
+
----------
|
32
|
+
folder_path : str
|
33
|
+
Relative path to the folder containing test files.
|
34
|
+
base_path : str, default="tests"
|
35
|
+
Base path used to resolve full path to test modules.
|
36
|
+
pattern : str, default="test_*.py"
|
37
|
+
Glob pattern to match test filenames.
|
38
|
+
test_name_pattern : Optional[str], optional
|
39
|
+
Regex pattern to filter discovered test method names.
|
40
|
+
|
41
|
+
Returns
|
42
|
+
-------
|
43
|
+
UnitTest
|
44
|
+
Self instance for chaining.
|
45
|
+
|
46
|
+
Raises
|
47
|
+
------
|
48
|
+
ValueError
|
49
|
+
If folder is invalid or no tests are found.
|
50
|
+
"""
|
51
|
+
pass
|
52
|
+
|
53
|
+
def run(self, print_result:bool = True, throw_exception:bool = False) -> Dict[str, Any]:
|
54
|
+
"""
|
55
|
+
Run all added tests and return a summary of the results.
|
56
|
+
|
57
|
+
Parameters
|
58
|
+
----------
|
59
|
+
print_result : bool, default=True
|
60
|
+
Whether to print a formatted report to the console.
|
61
|
+
throw_exception : bool, default=False
|
62
|
+
Raise an exception if there are failures or errors.
|
63
|
+
|
64
|
+
Returns
|
65
|
+
-------
|
66
|
+
Dict[str, Any]
|
67
|
+
Summary including:
|
68
|
+
- total_tests : int
|
69
|
+
- passed : int
|
70
|
+
- failed : int
|
71
|
+
- errors : int
|
72
|
+
- skipped : int
|
73
|
+
- total_time : str (e.g., '1.234 seconds')
|
74
|
+
- success_rate : str (e.g., '87.5%')
|
75
|
+
- test_details : List[Dict[str, Any]]
|
76
|
+
|
77
|
+
Raises
|
78
|
+
------
|
79
|
+
OrionisTestFailureException
|
80
|
+
If any test fails or errors occur and `throw_exception=True`.
|
81
|
+
"""
|
82
|
+
pass
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import os
|
2
2
|
import sys
|
3
3
|
from orionis.luminate.console.output.console import Console
|
4
|
+
from orionis.luminate.test.contracts.test_std_out import ITestStdOut
|
4
5
|
|
5
|
-
class TestStdOut:
|
6
|
+
class TestStdOut(ITestStdOut):
|
6
7
|
"""
|
7
8
|
A utility class for printing debug information during testing. This class temporarily
|
8
9
|
redirects the standard output and error streams to their original states to ensure
|
@@ -7,11 +7,12 @@ from contextlib import redirect_stdout, redirect_stderr
|
|
7
7
|
from dataclasses import asdict
|
8
8
|
from typing import Any, Dict, List, Optional, Tuple
|
9
9
|
from orionis.luminate.console.output.console import Console
|
10
|
+
from orionis.luminate.test.contracts.test_unit import IUnitTest
|
10
11
|
from orionis.luminate.test.test_exception import OrionisTestFailureException
|
11
12
|
from orionis.luminate.test.test_result import TestResult
|
12
13
|
from orionis.luminate.test.test_status import TestStatus
|
13
14
|
|
14
|
-
class UnitTest:
|
15
|
+
class UnitTest(IUnitTest):
|
15
16
|
"""
|
16
17
|
An advanced testing framework for discovering, running, and analyzing unit tests.
|
17
18
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
orionis/console.py,sha256=4gYWxf0fWYgJ4RKwARvnTPh06FL3GJ6SAZ7R2NzOICw,1342
|
3
|
-
orionis/framework.py,sha256=
|
3
|
+
orionis/framework.py,sha256=FaBRVAKmUaPiIZfyAYO_fDsoQioniy_o7AlvxNFzpT8,1458
|
4
4
|
orionis/installer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
orionis/installer/manager.py,sha256=Li4TVziRXWfum02xNG4JHwbnLk-u8xzHjdqKz-D894k,2755
|
6
6
|
orionis/installer/output.py,sha256=7O9qa2xtXMB_4ZvVi-Klneom9YazwygAd_4uYAoxhbU,8548
|
@@ -10,7 +10,7 @@ orionis/installer/contracts/manager.py,sha256=Zfndhuyu0JaTKo3PsGsKmVsvotQMw8Pmt4
|
|
10
10
|
orionis/installer/contracts/output.py,sha256=t1KLw610-hHy63UbFFE2BYwWHWRbW8_ofuEvRLx_IUE,983
|
11
11
|
orionis/installer/contracts/setup.py,sha256=aWYkCv-z48bXXZynYapc3uMIE1gyO6XnkTw3b4MTBq4,784
|
12
12
|
orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
-
orionis/luminate/application.py,sha256=
|
13
|
+
orionis/luminate/application.py,sha256=j6aEhCZhmann6HiuhoWmnJQbNTqZdu3oegPt0SQtJX4,9542
|
14
14
|
orionis/luminate/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
15
|
orionis/luminate/config/app.py,sha256=o-Ons0LMp77_E18e_dx_DqGVbjaY2l-5RdVSCILxgfg,1655
|
16
16
|
orionis/luminate/config/auth.py,sha256=ivAUgoEYEtfdC49vDwOl_MXFUVAQnUJTc8iG3Lu0Stc,430
|
@@ -48,7 +48,7 @@ orionis/luminate/container/container.py,sha256=9xdODX1h4YK6V-THrfgm5XN95imobExzr
|
|
48
48
|
orionis/luminate/container/container_integrity.py,sha256=6d9FsGk-Rm1AXgqBS3Nww49dR7n1ptXTTNyGUuBHgNY,10111
|
49
49
|
orionis/luminate/container/exception.py,sha256=ap1SqYEjQEEHXJJTNmL7V1jrmRjgT5_7geZ95MYkhMA,1691
|
50
50
|
orionis/luminate/container/lifetimes.py,sha256=2lbdiV7R2WlJf1cLD6eBxLnJud_lZvX1IhQH2Djy3Ww,375
|
51
|
-
orionis/luminate/container/resolve.py,sha256=
|
51
|
+
orionis/luminate/container/resolve.py,sha256=3wyMgJ0hQVAW_-Tx5nmXx3_nTjV_gSGNmqLZXUthgc8,2322
|
52
52
|
orionis/luminate/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
53
53
|
orionis/luminate/contracts/application.py,sha256=FIR6WMY0y-Hkjp0jWfjJV9kwIqBb-RB1-Jl0GWCk9eI,1077
|
54
54
|
orionis/luminate/contracts/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -67,7 +67,7 @@ orionis/luminate/contracts/console/output/progress_bar.py,sha256=sOkQzQsliFemqZH
|
|
67
67
|
orionis/luminate/contracts/container/container.py,sha256=rLOS1eYir1e1e06OVNTGESbR24rFOIU1CVni_8AbHgs,8802
|
68
68
|
orionis/luminate/contracts/container/container_integrity.py,sha256=xigWcyxLUaFoWXEI75ucJ50Ypw2NtOiRp_CgOY3Qk20,4408
|
69
69
|
orionis/luminate/contracts/facades/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
70
|
-
orionis/luminate/contracts/facades/facade.py,sha256=
|
70
|
+
orionis/luminate/contracts/facades/facade.py,sha256=LOACtfRduXo-0_de7smacMIGQHlap4D1y4oVTzsIK-Y,1516
|
71
71
|
orionis/luminate/contracts/facades/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
72
72
|
orionis/luminate/contracts/facades/commands/commands_facade.py,sha256=LpSfZb3lTmhgMx0H42NmFbKLvcOqSDIbpQrkQpF9RPY,1274
|
73
73
|
orionis/luminate/contracts/facades/commands/scheduler_facade.py,sha256=CR2E7WbYGt8ZMpekUzWBHCor3FEnBmYMDwPfKSYPq84,947
|
@@ -159,8 +159,11 @@ orionis/luminate/services/files/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
|
|
159
159
|
orionis/luminate/services/files/path_resolver_service.py,sha256=gCGVLtdXGuEIE6I8tm6JEB84HS1Fa5rk2whO2R6u8Wc,1698
|
160
160
|
orionis/luminate/services/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
161
161
|
orionis/luminate/services/log/log_service.py,sha256=jrCrKz7Uj6n_ri-v5A4YOILQGUQ9MAmrlSizbbOvKhI,8303
|
162
|
-
orionis/luminate/support/
|
163
|
-
orionis/luminate/support/dot_dict.py,sha256=FVHfBuAGTTVMjNG01Fix645fRNKKUMmNx61pYkxPL5c,1253
|
162
|
+
orionis/luminate/support/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
163
|
+
orionis/luminate/support/adapters/dot_dict.py,sha256=FVHfBuAGTTVMjNG01Fix645fRNKKUMmNx61pYkxPL5c,1253
|
164
|
+
orionis/luminate/support/async_io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
165
|
+
orionis/luminate/support/async_io/async_coroutine.py,sha256=EZJ0WUc5QX0G_KIhDAn6YQvPG6TI3A-oQI1Rjsp8NfU,2055
|
166
|
+
orionis/luminate/support/async_io/contracts/async_coroutine.py,sha256=D2NhVwPO_TKQ9UjLn61aeC0n7GmIXHtVpdel8pruXcI,763
|
164
167
|
orionis/luminate/support/inspection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
165
168
|
orionis/luminate/support/inspection/container_integrity.py,sha256=6d9FsGk-Rm1AXgqBS3Nww49dR7n1ptXTTNyGUuBHgNY,10111
|
166
169
|
orionis/luminate/support/inspection/functions.py,sha256=4wDT7iNp-5l4vuHk0UsIxN9wakASJRD4V0KY24uMDzk,7227
|
@@ -180,7 +183,7 @@ orionis/luminate/support/parsers/exception_parser.py,sha256=6MTeql76c1Muh9Nn-jz2
|
|
180
183
|
orionis/luminate/support/parsers/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
181
184
|
orionis/luminate/support/parsers/contracts/exception_parser.py,sha256=HcWN7nJrvD7xLREPKEnBhyG30IkkAB7Bx_hGpcfb0ZE,912
|
182
185
|
orionis/luminate/support/standard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
183
|
-
orionis/luminate/support/standard/std.py,sha256=
|
186
|
+
orionis/luminate/support/standard/std.py,sha256=t6dkZxOmSsu3yaIwlvRwdTcV-6KS8lZE5YuYv7FpCb0,3573
|
184
187
|
orionis/luminate/support/standard/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
185
188
|
orionis/luminate/support/standard/contracts/std.py,sha256=x9sVir2yg4hve56cCklIdVSr8utruIO_sUdlTNfZ1Ds,3109
|
186
189
|
orionis/luminate/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -188,9 +191,13 @@ orionis/luminate/test/test_case.py,sha256=y3-u3oJtCHLP-DoVW3jan2i96Y78VVdIM1pL7i
|
|
188
191
|
orionis/luminate/test/test_exception.py,sha256=21PILTXnMuL5-wT3HGKjIklt8VeIYDcQDN346i-BbJw,1336
|
189
192
|
orionis/luminate/test/test_result.py,sha256=Px2_M70r_y7BntRITk_h0IPTbSTW5XhDyklMKHm3JJI,999
|
190
193
|
orionis/luminate/test/test_status.py,sha256=vNKRmp1lud_ZGTayf3A8wO_0vEYdFABy_oMw-RcEc1c,673
|
191
|
-
orionis/luminate/test/test_std_out.py,sha256=
|
192
|
-
orionis/luminate/test/test_suite.py,sha256=
|
193
|
-
orionis/luminate/test/test_unit.py,sha256=
|
194
|
+
orionis/luminate/test/test_std_out.py,sha256=rPwXCf3qvMzkZHRCu03KvLCfD4K7cPOB02BZNpXtaiU,2851
|
195
|
+
orionis/luminate/test/test_suite.py,sha256=85OvJRZBzpFGxGw-28n0rXWYjbhACs0nZn5t3FHtzcg,2289
|
196
|
+
orionis/luminate/test/test_unit.py,sha256=ZTsGlFJ-vwc77sfb7kLDs_sAwJL4L1YP8R9nFUWlgZY,12146
|
197
|
+
orionis/luminate/test/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
198
|
+
orionis/luminate/test/contracts/test_std_out.py,sha256=ryvMotj-rpVKOsyGqW0B0IEHuF8DdQj1Rn0K8xiyBOE,489
|
199
|
+
orionis/luminate/test/contracts/test_suite.py,sha256=ieyhZLfC09VfMraskMdWUTUFAD03aaG_8FURWI_d_YQ,1214
|
200
|
+
orionis/luminate/test/contracts/test_unit.py,sha256=3euExuq7QgkJljnENxDyZW-okrw9S0apLnhf93o0Vqg,2612
|
194
201
|
orionis/static/ascii/icon.ascii,sha256=IgrlVjcYxcCrr0cJuJkOnEz0aEdAQBTyLzO5ainKsWc,398
|
195
202
|
orionis/static/ascii/info.ascii,sha256=HF_o2eXaiw5iqcOhHfnPByn5GJ_O2eBwSK3IpTfYOwY,457
|
196
203
|
orionis/static/bg/galaxy.jpg,sha256=_FuPghOe9LBrIWv1eKZ9fiZR72sEz5obvXGDnD7MzTc,172244
|
@@ -204,6 +211,12 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
204
211
|
tests/example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
205
212
|
tests/example/test_example.py,sha256=8EYjl1b-J_479dmJdQoAcKCKr7JUydW7EmPQpeiF13Y,586
|
206
213
|
tests/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
214
|
+
tests/support/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
215
|
+
tests/support/adapters/test_doct_dict.py,sha256=Rh0wUZLBErqrzwoRSUa7t1rpRm-Qp-HRYk2NMSvCSrg,806
|
216
|
+
tests/support/adapters/fakes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
217
|
+
tests/support/adapters/fakes/fake_dict.py,sha256=KD48_xBc8pqj3LAe1_v1esu-1Fdz8fL5eZ70LSqkcbg,393
|
218
|
+
tests/support/async_io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
219
|
+
tests/support/async_io/test_async_coroutine.py,sha256=1TW_gCmpN98210RV9EwpuuoEQfoFMd3VkPe0djqiang,1595
|
207
220
|
tests/support/inspection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
208
221
|
tests/support/inspection/test_reflection_abstract.py,sha256=6w8vm8H_fR4Z-KYjQGm8bq-HcetlpQl0EsDmDy3WzQ8,9311
|
209
222
|
tests/support/inspection/test_reflection_concrete.py,sha256=3BWSU7MkFEv2UgAVAwhiaMrzEwAyDBBJCa6edOENKSU,6782
|
@@ -222,9 +235,9 @@ tests/support/parsers/fakes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
|
|
222
235
|
tests/support/parsers/fakes/fake_custom_error.py,sha256=BD8tQPhmIYFYVcaeMpEQ6uK1d6pcU4EGbwRkVfCZp7c,802
|
223
236
|
tests/support/standard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
224
237
|
tests/support/standard/test_std.py,sha256=bJ5LV_OKEEZa_Bk3PTk9Kapk6qECLzcKf0hfR_x2QqM,2042
|
225
|
-
orionis-0.
|
226
|
-
orionis-0.
|
227
|
-
orionis-0.
|
228
|
-
orionis-0.
|
229
|
-
orionis-0.
|
230
|
-
orionis-0.
|
238
|
+
orionis-0.219.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
239
|
+
orionis-0.219.0.dist-info/METADATA,sha256=W5NoZ3LdC1k5d1-FS5YxhFFmRekdIanU22_-7aD7Zh4,3003
|
240
|
+
orionis-0.219.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
241
|
+
orionis-0.219.0.dist-info/entry_points.txt,sha256=a_e0faeSqyUCVZd0MqljQ2oaHHdlsz6g9sU_bMqi5zQ,49
|
242
|
+
orionis-0.219.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
243
|
+
orionis-0.219.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
fake_dict = {
|
2
|
+
"type": "framework",
|
3
|
+
"name": "Orionis Framework",
|
4
|
+
"features": {
|
5
|
+
"authentication": True,
|
6
|
+
"csrf_protection": True,
|
7
|
+
"session_management": True,
|
8
|
+
"logging": True,
|
9
|
+
"error_handling": True,
|
10
|
+
"database_integration": True,
|
11
|
+
"template_engine": True,
|
12
|
+
"api_support": True,
|
13
|
+
"routing": True
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
from orionis.luminate.support.adapters.dot_dict import DotDict
|
2
|
+
from orionis.luminate.test.test_case import TestCase
|
3
|
+
from tests.support.adapters.fakes.fake_dict import fake_dict
|
4
|
+
|
5
|
+
class TestsDotDict(TestCase):
|
6
|
+
|
7
|
+
async def testAccessByDot(self):
|
8
|
+
"""
|
9
|
+
Test the ability to access dictionary values using dot notation.
|
10
|
+
"""
|
11
|
+
# Create a DotDict instance from the fake_dict
|
12
|
+
dot_dict = DotDict(fake_dict)
|
13
|
+
|
14
|
+
# Access the 'type' attribute using dot notation
|
15
|
+
self.assertEqual(dot_dict.type, "framework")
|
16
|
+
|
17
|
+
# Access the 'name' attribute using dot notation
|
18
|
+
self.assertEqual(dot_dict.name, "Orionis Framework")
|
19
|
+
|
20
|
+
# Access a nested attribute using dot notation
|
21
|
+
self.assertEqual(dot_dict.features.authentication, True)
|
File without changes
|
@@ -0,0 +1,35 @@
|
|
1
|
+
from orionis.luminate.support.async_io.async_coroutine import AsyncCoroutine
|
2
|
+
from orionis.luminate.test.test_case import TestCase
|
3
|
+
from tests.support.adapters.fakes.fake_dict import fake_dict
|
4
|
+
|
5
|
+
class TestsAsyncCoroutine(TestCase):
|
6
|
+
|
7
|
+
async def testExecuteWithActiveEventLoop(self):
|
8
|
+
"""
|
9
|
+
Test the execution of a coroutine within an active event loop.
|
10
|
+
This test simulates a scenario where the coroutine is executed in an environment with an active event loop,
|
11
|
+
such as a Jupyter notebook or a Starlette application.
|
12
|
+
"""
|
13
|
+
async def sample_coroutine():
|
14
|
+
return "Hello, World!"
|
15
|
+
|
16
|
+
result = await AsyncCoroutine.execute(sample_coroutine())
|
17
|
+
self.assertEqual(result, "Hello, World!")
|
18
|
+
|
19
|
+
async def testExecuteWithoutActiveEventLoop(self):
|
20
|
+
"""
|
21
|
+
Test the execution of a coroutine without an active event loop.
|
22
|
+
This test simulates a scenario where the coroutine is executed in a synchronous context without an active event loop.
|
23
|
+
"""
|
24
|
+
async def sample_coroutine():
|
25
|
+
return "Hello, World!"
|
26
|
+
result = await AsyncCoroutine.execute(sample_coroutine())
|
27
|
+
self.assertEqual(result, "Hello, World!")
|
28
|
+
|
29
|
+
async def testExecuteWithNonCoroutine(self):
|
30
|
+
"""
|
31
|
+
Test the execution of a non-coroutine object.
|
32
|
+
This test checks that a TypeError is raised when a non-coroutine object is passed to the execute method.
|
33
|
+
"""
|
34
|
+
with self.assertRaises(TypeError) as context:
|
35
|
+
AsyncCoroutine.execute("not a coroutine")
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import asyncio
|
2
|
-
import logging
|
3
|
-
from typing import Any, Coroutine, TypeVar
|
4
|
-
|
5
|
-
T = TypeVar("T")
|
6
|
-
|
7
|
-
class AsyncExecutor:
|
8
|
-
""" Utility class to run asynchronous functions synchronously. """
|
9
|
-
|
10
|
-
@staticmethod
|
11
|
-
def run(callback: Coroutine[Any, Any, T]) -> T:
|
12
|
-
"""
|
13
|
-
Runs an asynchronous coroutine in a synchronous context.
|
14
|
-
|
15
|
-
Parameters
|
16
|
-
----------
|
17
|
-
callback : Coroutine[Any, Any, T]
|
18
|
-
The asynchronous coroutine to execute.
|
19
|
-
|
20
|
-
Returns
|
21
|
-
-------
|
22
|
-
T
|
23
|
-
The result of the coroutine execution.
|
24
|
-
|
25
|
-
Raises
|
26
|
-
------
|
27
|
-
Exception
|
28
|
-
If the coroutine execution fails.
|
29
|
-
"""
|
30
|
-
logging.getLogger('asyncio').setLevel(logging.WARNING)
|
31
|
-
|
32
|
-
try:
|
33
|
-
loop = asyncio.get_running_loop()
|
34
|
-
except RuntimeError:
|
35
|
-
loop = asyncio.new_event_loop()
|
36
|
-
asyncio.set_event_loop(loop)
|
37
|
-
|
38
|
-
try:
|
39
|
-
return loop.run_until_complete(callback)
|
40
|
-
except Exception as e:
|
41
|
-
raise RuntimeError(f"Error executing coroutine: {e}") from e
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|