orionis 0.404.0__py3-none-any.whl → 0.406.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/command.py +57 -50
- orionis/console/base/contracts/command.py +68 -0
- orionis/console/dynamic/contracts/progress_bar.py +3 -3
- orionis/console/dynamic/progress_bar.py +8 -8
- orionis/console/output/console.py +8 -2
- orionis/console/output/contracts/console.py +1 -1
- orionis/container/container.py +2 -2
- orionis/container/context/scope.py +4 -1
- orionis/container/contracts/service_provider.py +2 -2
- orionis/container/entities/binding.py +31 -44
- orionis/container/enums/lifetimes.py +22 -1
- orionis/container/facades/facade.py +1 -2
- orionis/container/providers/service_provider.py +2 -2
- orionis/foundation/application.py +542 -248
- orionis/foundation/config/app/entities/app.py +107 -90
- orionis/foundation/config/auth/entities/auth.py +4 -33
- orionis/foundation/config/cache/entities/cache.py +18 -41
- orionis/foundation/config/cache/entities/file.py +8 -35
- orionis/foundation/config/cache/entities/stores.py +17 -38
- orionis/foundation/config/cors/entities/cors.py +41 -54
- orionis/foundation/config/database/entities/connections.py +40 -56
- orionis/foundation/config/database/entities/database.py +11 -38
- orionis/foundation/config/database/entities/mysql.py +48 -76
- orionis/foundation/config/database/entities/oracle.py +30 -57
- orionis/foundation/config/database/entities/pgsql.py +45 -61
- orionis/foundation/config/database/entities/sqlite.py +26 -53
- orionis/foundation/config/filesystems/entitites/aws.py +28 -49
- orionis/foundation/config/filesystems/entitites/disks.py +27 -47
- orionis/foundation/config/filesystems/entitites/filesystems.py +15 -37
- orionis/foundation/config/filesystems/entitites/local.py +9 -35
- orionis/foundation/config/filesystems/entitites/public.py +14 -41
- orionis/foundation/config/logging/entities/channels.py +56 -86
- orionis/foundation/config/logging/entities/chunked.py +18 -10
- orionis/foundation/config/logging/entities/daily.py +17 -9
- orionis/foundation/config/logging/entities/hourly.py +15 -7
- orionis/foundation/config/logging/entities/logging.py +12 -18
- orionis/foundation/config/logging/entities/monthly.py +16 -8
- orionis/foundation/config/logging/entities/stack.py +15 -7
- orionis/foundation/config/logging/entities/weekly.py +15 -7
- orionis/foundation/config/logging/validators/path.py +6 -0
- orionis/foundation/config/mail/entities/file.py +9 -36
- orionis/foundation/config/mail/entities/mail.py +22 -40
- orionis/foundation/config/mail/entities/mailers.py +29 -44
- orionis/foundation/config/mail/entities/smtp.py +47 -48
- orionis/foundation/config/queue/entities/brokers.py +19 -41
- orionis/foundation/config/queue/entities/database.py +24 -46
- orionis/foundation/config/queue/entities/queue.py +28 -40
- orionis/foundation/config/roots/paths.py +272 -468
- orionis/foundation/config/session/entities/session.py +23 -53
- orionis/foundation/config/startup.py +165 -135
- orionis/foundation/config/testing/entities/testing.py +137 -122
- orionis/foundation/config/testing/enums/__init__.py +6 -2
- orionis/foundation/config/testing/enums/drivers.py +16 -0
- orionis/foundation/config/testing/enums/verbosity.py +18 -0
- orionis/foundation/contracts/application.py +152 -362
- orionis/foundation/providers/console_provider.py +24 -2
- orionis/foundation/providers/dumper_provider.py +24 -2
- orionis/foundation/providers/logger_provider.py +24 -2
- orionis/foundation/providers/path_resolver_provider.py +25 -2
- orionis/foundation/providers/progress_bar_provider.py +24 -2
- orionis/foundation/providers/testing_provider.py +39 -0
- orionis/foundation/providers/workers_provider.py +24 -2
- orionis/metadata/framework.py +1 -1
- orionis/services/environment/helpers/functions.py +1 -2
- orionis/services/environment/key/__init__.py +0 -0
- orionis/services/environment/key/key_generator.py +37 -0
- orionis/services/log/handlers/filename.py +64 -0
- orionis/services/log/handlers/size_rotating.py +9 -40
- orionis/services/log/handlers/timed_rotating.py +9 -41
- orionis/services/log/log_service.py +9 -52
- orionis/support/entities/__init__.py +0 -0
- orionis/support/entities/base.py +104 -0
- orionis/support/facades/testing.py +15 -0
- orionis/support/facades/workers.py +1 -1
- orionis/test/cases/asynchronous.py +0 -11
- orionis/test/cases/synchronous.py +0 -9
- orionis/test/contracts/dumper.py +11 -4
- orionis/test/contracts/kernel.py +5 -110
- orionis/test/contracts/logs.py +27 -65
- orionis/test/contracts/printer.py +16 -128
- orionis/test/contracts/test_result.py +100 -0
- orionis/test/contracts/unit_test.py +87 -150
- orionis/test/core/unit_test.py +608 -554
- orionis/test/entities/result.py +22 -2
- orionis/test/enums/__init__.py +0 -2
- orionis/test/enums/status.py +14 -9
- orionis/test/exceptions/config.py +9 -1
- orionis/test/exceptions/failure.py +34 -11
- orionis/test/exceptions/persistence.py +10 -2
- orionis/test/exceptions/runtime.py +9 -1
- orionis/test/exceptions/value.py +13 -1
- orionis/test/kernel.py +87 -289
- orionis/test/output/dumper.py +82 -18
- orionis/test/output/printer.py +399 -156
- orionis/test/records/logs.py +203 -82
- orionis/test/validators/__init__.py +33 -0
- orionis/test/validators/base_path.py +45 -0
- orionis/test/validators/execution_mode.py +45 -0
- orionis/test/validators/fail_fast.py +37 -0
- orionis/test/validators/folder_path.py +34 -0
- orionis/test/validators/module_name.py +31 -0
- orionis/test/validators/name_pattern.py +40 -0
- orionis/test/validators/pattern.py +36 -0
- orionis/test/validators/persistent.py +42 -0
- orionis/test/validators/persistent_driver.py +43 -0
- orionis/test/validators/print_result.py +37 -0
- orionis/test/validators/tags.py +37 -0
- orionis/test/validators/throw_exception.py +39 -0
- orionis/test/validators/verbosity.py +37 -0
- orionis/test/validators/web_report.py +35 -0
- orionis/test/validators/workers.py +31 -0
- orionis/test/view/render.py +48 -54
- {orionis-0.404.0.dist-info → orionis-0.406.0.dist-info}/METADATA +1 -1
- {orionis-0.404.0.dist-info → orionis-0.406.0.dist-info}/RECORD +160 -108
- tests/container/__init__.py +0 -0
- tests/container/context/__init__.py +0 -0
- tests/container/context/test_manager.py +27 -0
- tests/container/context/test_scope.py +23 -0
- tests/container/entities/__init__.py +0 -0
- tests/container/entities/test_binding.py +133 -0
- tests/container/enums/__init__.py +0 -0
- tests/container/enums/test_lifetimes.py +63 -0
- tests/container/facades/__init__.py +0 -0
- tests/container/facades/test_facade.py +61 -0
- tests/container/mocks/__init__.py +0 -0
- tests/container/mocks/mock_complex_classes.py +482 -0
- tests/container/mocks/mock_simple_classes.py +32 -0
- tests/container/providers/__init__.py +0 -0
- tests/container/providers/test_providers.py +48 -0
- tests/container/resolver/__init__.py +0 -0
- tests/container/resolver/test_resolver.py +55 -0
- tests/container/test_container.py +254 -0
- tests/container/test_singleton.py +98 -0
- tests/container/test_thread_safety.py +217 -0
- tests/container/validators/__init__.py +0 -0
- tests/container/validators/test_implements.py +140 -0
- tests/container/validators/test_is_abstract_class.py +99 -0
- tests/container/validators/test_is_callable.py +73 -0
- tests/container/validators/test_is_concrete_class.py +97 -0
- tests/container/validators/test_is_instance.py +105 -0
- tests/container/validators/test_is_not_subclass.py +117 -0
- tests/container/validators/test_is_subclass.py +115 -0
- tests/container/validators/test_is_valid_alias.py +113 -0
- tests/container/validators/test_lifetime.py +75 -0
- tests/foundation/config/logging/test_foundation_config_logging_chunked.py +12 -34
- tests/foundation/config/logging/test_foundation_config_logging_daily.py +11 -11
- tests/foundation/config/logging/test_foundation_config_logging_hourly.py +7 -8
- tests/foundation/config/logging/test_foundation_config_logging_monthly.py +7 -10
- tests/foundation/config/logging/test_foundation_config_logging_stack.py +6 -11
- tests/foundation/config/logging/test_foundation_config_logging_weekly.py +6 -5
- tests/foundation/config/testing/test_foundation_config_testing.py +1 -1
- tests/metadata/test_metadata_framework.py +18 -18
- tests/testing/test_testing_result.py +117 -117
- tests/testing/test_testing_unit.py +209 -209
- orionis/foundation/config/base.py +0 -112
- orionis/test/arguments/parser.py +0 -187
- orionis/test/contracts/parser.py +0 -43
- orionis/test/entities/arguments.py +0 -38
- orionis/test/enums/execution_mode.py +0 -16
- /orionis/{test/arguments → console/base/contracts}/__init__.py +0 -0
- /orionis/foundation/config/testing/enums/{test_mode.py → mode.py} +0 -0
- {orionis-0.404.0.dist-info → orionis-0.406.0.dist-info}/WHEEL +0 -0
- {orionis-0.404.0.dist-info → orionis-0.406.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.404.0.dist-info → orionis-0.406.0.dist-info}/top_level.txt +0 -0
- {orionis-0.404.0.dist-info → orionis-0.406.0.dist-info}/zip-safe +0 -0
|
@@ -24,7 +24,7 @@ class TestMetadataFramework(AsyncTestCase):
|
|
|
24
24
|
NAME, VERSION, AUTHOR, AUTHOR_EMAIL, DESCRIPTION,
|
|
25
25
|
SKELETON, FRAMEWORK, DOCS, API, PYTHON_REQUIRES
|
|
26
26
|
]:
|
|
27
|
-
|
|
27
|
+
self.assertIsInstance(const, str)
|
|
28
28
|
|
|
29
29
|
async def testClassifiersStructure(self):
|
|
30
30
|
"""
|
|
@@ -35,10 +35,10 @@ class TestMetadataFramework(AsyncTestCase):
|
|
|
35
35
|
AssertionError
|
|
36
36
|
If `CLASSIFIERS` is not a list of tuples of strings.
|
|
37
37
|
"""
|
|
38
|
-
|
|
38
|
+
self.assertIsInstance(CLASSIFIERS, list)
|
|
39
39
|
for item in CLASSIFIERS:
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
self.assertIsInstance(item, tuple)
|
|
41
|
+
self.assertTrue(all(isinstance(part, str) for part in item))
|
|
42
42
|
|
|
43
43
|
async def testGetClassifiers(self):
|
|
44
44
|
"""
|
|
@@ -50,10 +50,10 @@ class TestMetadataFramework(AsyncTestCase):
|
|
|
50
50
|
If the returned value is not a list of strings containing '::'.
|
|
51
51
|
"""
|
|
52
52
|
classifiers = get_classifiers()
|
|
53
|
-
|
|
53
|
+
self.assertIsInstance(classifiers, list)
|
|
54
54
|
for c in classifiers:
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
self.assertIsInstance(c, str)
|
|
56
|
+
self.assertTrue(" :: " in c or len(c.split(" :: ")) > 1)
|
|
57
57
|
|
|
58
58
|
async def testKeywords(self):
|
|
59
59
|
"""
|
|
@@ -64,11 +64,11 @@ class TestMetadataFramework(AsyncTestCase):
|
|
|
64
64
|
AssertionError
|
|
65
65
|
If `KEYWORDS` is not a list of strings or required keywords are missing.
|
|
66
66
|
"""
|
|
67
|
-
|
|
67
|
+
self.assertIsInstance(KEYWORDS, list)
|
|
68
68
|
for kw in KEYWORDS:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
self.assertIsInstance(kw, str)
|
|
70
|
+
self.assertIn("orionis", KEYWORDS)
|
|
71
|
+
self.assertIn("framework", KEYWORDS)
|
|
72
72
|
|
|
73
73
|
async def testRequiresStructure(self):
|
|
74
74
|
"""
|
|
@@ -79,11 +79,11 @@ class TestMetadataFramework(AsyncTestCase):
|
|
|
79
79
|
AssertionError
|
|
80
80
|
If `REQUIRES` is not a list of 2-element tuples of strings.
|
|
81
81
|
"""
|
|
82
|
-
|
|
82
|
+
self.assertIsInstance(REQUIRES, list)
|
|
83
83
|
for req in REQUIRES:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
self.assertIsInstance(req, tuple)
|
|
85
|
+
self.assertEqual(len(req), 2)
|
|
86
|
+
self.assertTrue(all(isinstance(part, str) for part in req))
|
|
87
87
|
|
|
88
88
|
async def testGetRequires(self):
|
|
89
89
|
"""
|
|
@@ -95,7 +95,7 @@ class TestMetadataFramework(AsyncTestCase):
|
|
|
95
95
|
If the returned value is not a list of strings containing '>='.
|
|
96
96
|
"""
|
|
97
97
|
requires = get_requires()
|
|
98
|
-
|
|
98
|
+
self.assertIsInstance(requires, list)
|
|
99
99
|
for req in requires:
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
self.assertIsInstance(req, str)
|
|
101
|
+
self.assertIn(">=", req)
|
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
2
|
-
from orionis.test.entities.result import TestResult
|
|
3
|
-
from orionis.test.enums import TestStatus
|
|
1
|
+
# from orionis.test.cases.asynchronous import AsyncTestCase
|
|
2
|
+
# from orionis.test.entities.result import TestResult
|
|
3
|
+
# from orionis.test.enums import TestStatus
|
|
4
4
|
|
|
5
|
-
class TestTestingResult(AsyncTestCase):
|
|
5
|
+
# class TestTestingResult(AsyncTestCase):
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
# async def testDefaultValues(self) -> None:
|
|
8
|
+
# """
|
|
9
|
+
# Ensures that when optional fields are not provided during initialization of a TestResult
|
|
10
|
+
# instance, they are set to None.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
# Notes
|
|
13
|
+
# -----
|
|
14
|
+
# This test verifies the default behavior of the following optional fields:
|
|
15
|
+
# - error_message
|
|
16
|
+
# - traceback
|
|
17
|
+
# - class_name
|
|
18
|
+
# - method
|
|
19
|
+
# - module
|
|
20
|
+
# - file_path
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
# Assertions
|
|
23
|
+
# ----------
|
|
24
|
+
# Each optional field is checked to confirm it is None after initialization.
|
|
25
|
+
# """
|
|
26
|
+
# result = TestResult(
|
|
27
|
+
# id=1,
|
|
28
|
+
# name="Sample Test",
|
|
29
|
+
# status=TestStatus.PASSED,
|
|
30
|
+
# execution_time=0.5
|
|
31
|
+
# )
|
|
32
|
+
# self.assertIsNone(result.error_message)
|
|
33
|
+
# self.assertIsNone(result.traceback)
|
|
34
|
+
# self.assertIsNone(result.class_name)
|
|
35
|
+
# self.assertIsNone(result.method)
|
|
36
|
+
# self.assertIsNone(result.module)
|
|
37
|
+
# self.assertIsNone(result.file_path)
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
# async def testRequiredFields(self) -> None:
|
|
40
|
+
# """
|
|
41
|
+
# Test that TestResult enforces the presence of all required (non-optional) fields during initialization.
|
|
42
|
+
# This test verifies that omitting any required field when creating a TestResult instance raises a TypeError.
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
# Notes
|
|
45
|
+
# -----
|
|
46
|
+
# - Attempts to instantiate TestResult with no arguments.
|
|
47
|
+
# - Attempts to instantiate TestResult missing the 'id' field.
|
|
48
|
+
# - Expects a TypeError to be raised in both cases.
|
|
49
|
+
# """
|
|
50
|
+
# with self.assertRaises(TypeError):
|
|
51
|
+
# TestResult() # Missing all required fields
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
# with self.assertRaises(TypeError):
|
|
54
|
+
# # Missing id
|
|
55
|
+
# TestResult(
|
|
56
|
+
# name="Sample Test",
|
|
57
|
+
# status=TestStatus.PASSED,
|
|
58
|
+
# execution_time=0.5
|
|
59
|
+
# )
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
# async def testImmutable(self) -> None:
|
|
62
|
+
# """
|
|
63
|
+
# Test the immutability of TestResult instances.
|
|
64
|
+
# This test ensures that TestResult, implemented as a frozen dataclass, does not allow
|
|
65
|
+
# modification of its attributes after instantiation.
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
# Parameters
|
|
68
|
+
# ----------
|
|
69
|
+
# self : TestCase
|
|
70
|
+
# The test case instance.
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
72
|
+
# Raises
|
|
73
|
+
# ------
|
|
74
|
+
# FrozenInstanceError
|
|
75
|
+
# If an attempt is made to modify an attribute of a frozen TestResult instance.
|
|
76
|
+
# """
|
|
77
|
+
# result = TestResult(
|
|
78
|
+
# id=1,
|
|
79
|
+
# name="Sample Test",
|
|
80
|
+
# status=TestStatus.PASSED,
|
|
81
|
+
# execution_time=0.5
|
|
82
|
+
# )
|
|
83
|
+
# with self.assertRaises(Exception):
|
|
84
|
+
# result.name = "Modified Name"
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
# async def testStatusValues(self) -> None:
|
|
87
|
+
# """
|
|
88
|
+
# Parameters
|
|
89
|
+
# ----------
|
|
90
|
+
# self : TestCase
|
|
91
|
+
# The test case instance.
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
93
|
+
# Notes
|
|
94
|
+
# -----
|
|
95
|
+
# This test iterates over all possible values of the `TestStatus` enum and verifies
|
|
96
|
+
# that each value can be assigned to the `status` field of a `TestResult` instance.
|
|
97
|
+
# It asserts that the assigned status matches the expected value.
|
|
98
|
+
# """
|
|
99
|
+
# for status in TestStatus:
|
|
100
|
+
# result = TestResult(
|
|
101
|
+
# id=1,
|
|
102
|
+
# name="Status Test",
|
|
103
|
+
# status=status,
|
|
104
|
+
# execution_time=0.1
|
|
105
|
+
# )
|
|
106
|
+
# self.assertEqual(result.status, status)
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
# async def testErrorFields(self) -> None:
|
|
109
|
+
# """
|
|
110
|
+
# Parameters
|
|
111
|
+
# ----------
|
|
112
|
+
# self : TestCase
|
|
113
|
+
# The test case instance.
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
115
|
+
# Notes
|
|
116
|
+
# -----
|
|
117
|
+
# Verifies that the `error_message` and `traceback` fields are correctly stored in the `TestResult`
|
|
118
|
+
# object when provided during initialization.
|
|
119
|
+
# """
|
|
120
|
+
# error_msg = "Test failed"
|
|
121
|
+
# traceback = "Traceback info"
|
|
122
|
+
# result = TestResult(
|
|
123
|
+
# id=1,
|
|
124
|
+
# name="Failing Test",
|
|
125
|
+
# status=TestStatus.FAILED,
|
|
126
|
+
# execution_time=0.2,
|
|
127
|
+
# error_message=error_msg,
|
|
128
|
+
# traceback=traceback
|
|
129
|
+
# )
|
|
130
|
+
# self.assertEqual(result.error_message, error_msg)
|
|
131
|
+
# self.assertEqual(result.traceback, traceback)
|