orionis 0.217.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.
Files changed (38) hide show
  1. orionis/framework.py +2 -2
  2. orionis/luminate/application.py +1 -1
  3. orionis/luminate/container/resolve.py +1 -1
  4. orionis/luminate/contracts/facades/facade.py +1 -1
  5. orionis/luminate/support/adapters/__init__.py +0 -0
  6. orionis/luminate/support/async_io/__init__.py +0 -0
  7. orionis/luminate/support/async_io/async_coroutine.py +48 -0
  8. orionis/luminate/support/async_io/contracts/async_coroutine.py +31 -0
  9. orionis/luminate/support/standard/std.py +0 -9
  10. orionis/luminate/test/contracts/__init__.py +0 -0
  11. orionis/luminate/test/contracts/test_std_out.py +17 -0
  12. orionis/luminate/test/contracts/test_suite.py +37 -0
  13. orionis/luminate/test/contracts/test_unit.py +82 -0
  14. orionis/luminate/test/test_case.py +58 -1
  15. orionis/luminate/test/test_std_out.py +3 -2
  16. orionis/luminate/test/test_suite.py +2 -1
  17. orionis/luminate/test/test_unit.py +2 -1
  18. {orionis-0.217.0.dist-info → orionis-0.219.0.dist-info}/METADATA +1 -1
  19. {orionis-0.217.0.dist-info → orionis-0.219.0.dist-info}/RECORD +37 -24
  20. tests/support/adapters/__init__.py +0 -0
  21. tests/support/adapters/fakes/__init__.py +0 -0
  22. tests/support/adapters/fakes/fake_dict.py +15 -0
  23. tests/support/adapters/test_doct_dict.py +21 -0
  24. tests/support/async_io/__init__.py +0 -0
  25. tests/support/async_io/test_async_coroutine.py +35 -0
  26. tests/support/inspection/test_reflection_abstract.py +21 -21
  27. tests/support/inspection/test_reflection_concrete.py +20 -20
  28. tests/support/inspection/test_reflection_concrete_with_abstract.py +5 -5
  29. tests/support/inspection/test_reflection_instance.py +26 -23
  30. tests/support/inspection/test_reflection_instance_with_abstract.py +5 -5
  31. tests/support/parsers/test_exception_parser.py +4 -4
  32. tests/support/standard/test_std.py +10 -10
  33. orionis/luminate/support/asyn_run.py +0 -41
  34. /orionis/luminate/support/{dot_dict.py → adapters/dot_dict.py} +0 -0
  35. {orionis-0.217.0.dist-info → orionis-0.219.0.dist-info}/LICENCE +0 -0
  36. {orionis-0.217.0.dist-info → orionis-0.219.0.dist-info}/WHEEL +0 -0
  37. {orionis-0.217.0.dist-info → orionis-0.219.0.dist-info}/entry_points.txt +0 -0
  38. {orionis-0.217.0.dist-info → orionis-0.219.0.dist-info}/top_level.txt +0 -0
@@ -3,7 +3,7 @@ from orionis.luminate.test.test_case import TestCase
3
3
 
4
4
  class TestStdClass(TestCase):
5
5
 
6
- def testInitializationAndAccess(self):
6
+ async def testInitializationAndAccess(self):
7
7
  obj = StdClass(
8
8
  first_name='Raul',
9
9
  last_name='Uñate',
@@ -12,49 +12,49 @@ class TestStdClass(TestCase):
12
12
  self.assertEqual(obj.first_name, 'Raul')
13
13
  self.assertEqual(obj.age, 31)
14
14
 
15
- def testToDictReturnsCorrectData(self):
15
+ async def testToDictReturnsCorrectData(self):
16
16
  obj = StdClass(a=1, b=2)
17
17
  expected = {'a': 1, 'b': 2}
18
18
  self.assertEqual(obj.toDict(), expected)
19
19
 
20
- def testUpdateAttributes(self):
20
+ async def testUpdateAttributes(self):
21
21
  obj = StdClass()
22
22
  obj.update(foo='bar', number=42)
23
23
  self.assertEqual(obj.foo, 'bar')
24
24
  self.assertEqual(obj.number, 42)
25
25
 
26
- def testUpdateReservedAttributeRaisesError(self):
26
+ async def testUpdateReservedAttributeRaisesError(self):
27
27
  obj = StdClass()
28
28
  with self.assertRaises(ValueError):
29
29
  obj.update(__init__='bad')
30
30
 
31
- def testUpdateConflictingAttributeRaisesError(self):
31
+ async def testUpdateConflictingAttributeRaisesError(self):
32
32
  obj = StdClass()
33
33
  with self.assertRaises(ValueError):
34
34
  obj.update(toDict='oops')
35
35
 
36
- def testRemoveExistingAttributes(self):
36
+ async def testRemoveExistingAttributes(self):
37
37
  obj = StdClass(x=1, y=2)
38
38
  obj.remove('x')
39
39
  self.assertFalse(hasattr(obj, 'x'))
40
40
  self.assertTrue(hasattr(obj, 'y'))
41
41
 
42
- def testRemoveNonExistingAttributeRaisesError(self):
42
+ async def testRemoveNonExistingAttributeRaisesError(self):
43
43
  obj = StdClass()
44
44
  with self.assertRaises(AttributeError):
45
45
  obj.remove('not_there')
46
46
 
47
- def testFromDictCreatesEquivalentInstance(self):
47
+ async def testFromDictCreatesEquivalentInstance(self):
48
48
  data = {'a': 10, 'b': 20}
49
49
  obj = StdClass.from_dict(data)
50
50
  self.assertEqual(obj.toDict(), data)
51
51
 
52
- def testReprAndStr(self):
52
+ async def testReprAndStr(self):
53
53
  obj = StdClass(x=5)
54
54
  self.assertIn("StdClass", repr(obj))
55
55
  self.assertIn("'x': 5", str(obj))
56
56
 
57
- def testEquality(self):
57
+ async def testEquality(self):
58
58
  a = StdClass(x=1, y=2)
59
59
  b = StdClass(x=1, y=2)
60
60
  c = StdClass(x=3)
@@ -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