orionis 0.405.0__py3-none-any.whl → 0.407.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 +9 -9
- orionis/foundation/config/logging/entities/daily.py +8 -8
- orionis/foundation/config/logging/entities/hourly.py +6 -6
- orionis/foundation/config/logging/entities/logging.py +12 -18
- orionis/foundation/config/logging/entities/monthly.py +7 -7
- orionis/foundation/config/logging/entities/stack.py +5 -5
- orionis/foundation/config/logging/entities/weekly.py +6 -6
- 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/asynchrony/contracts/coroutines.py +13 -5
- orionis/services/asynchrony/coroutines.py +33 -29
- orionis/services/asynchrony/exceptions/exception.py +9 -1
- orionis/services/environment/core/dot_env.py +46 -34
- orionis/services/environment/enums/__init__.py +0 -0
- orionis/services/environment/enums/cast_type.py +42 -0
- 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/environment/serializer/__init__.py +0 -0
- orionis/services/environment/serializer/values.py +21 -0
- orionis/services/environment/validators/__init__.py +0 -0
- orionis/services/environment/validators/key_name.py +46 -0
- orionis/services/environment/validators/types.py +45 -0
- orionis/services/system/contracts/imports.py +38 -18
- orionis/services/system/contracts/workers.py +29 -12
- orionis/services/system/imports.py +65 -25
- orionis/services/system/runtime/imports.py +18 -9
- orionis/services/system/workers.py +49 -16
- 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 +83 -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.405.0.dist-info → orionis-0.407.0.dist-info}/METADATA +1 -1
- {orionis-0.405.0.dist-info → orionis-0.407.0.dist-info}/RECORD +170 -112
- 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/example/test_example.py +2 -2
- tests/foundation/config/testing/test_foundation_config_testing.py +1 -1
- tests/metadata/test_metadata_framework.py +89 -24
- tests/metadata/test_metadata_package.py +55 -10
- tests/services/asynchrony/test_services_asynchrony_coroutine.py +52 -7
- tests/services/system/test_services_system_imports.py +119 -16
- tests/services/system/test_services_system_workers.py +71 -30
- 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.405.0.dist-info → orionis-0.407.0.dist-info}/WHEEL +0 -0
- {orionis-0.405.0.dist-info → orionis-0.407.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.405.0.dist-info → orionis-0.407.0.dist-info}/top_level.txt +0 -0
- {orionis-0.405.0.dist-info → orionis-0.407.0.dist-info}/zip-safe +0 -0
orionis/test/arguments/parser.py
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import argparse
|
|
2
|
-
from orionis.test.contracts.parser import ITestArgumentParser
|
|
3
|
-
from orionis.test.entities.arguments import TestArguments
|
|
4
|
-
|
|
5
|
-
class TestArgumentParser(ITestArgumentParser):
|
|
6
|
-
"""
|
|
7
|
-
A parser class for handling test command-line arguments.
|
|
8
|
-
|
|
9
|
-
This class encapsulates the logic for creating and configuring the argument parser
|
|
10
|
-
for the Orionis test runner, providing a clean interface for parsing test arguments.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
def __init__(
|
|
14
|
-
self
|
|
15
|
-
) -> None:
|
|
16
|
-
"""Initialize the argument parser with all required arguments."""
|
|
17
|
-
self.parser = self.__create()
|
|
18
|
-
|
|
19
|
-
def __create(
|
|
20
|
-
self
|
|
21
|
-
) -> argparse.ArgumentParser:
|
|
22
|
-
"""
|
|
23
|
-
Create and configure the argument parser with all test-related arguments.
|
|
24
|
-
|
|
25
|
-
Returns
|
|
26
|
-
-------
|
|
27
|
-
argparse.ArgumentParser
|
|
28
|
-
The configured argument parser instance.
|
|
29
|
-
"""
|
|
30
|
-
parser = argparse.ArgumentParser(description="Run Orionis tests.")
|
|
31
|
-
|
|
32
|
-
# Basic test configuration
|
|
33
|
-
parser.add_argument(
|
|
34
|
-
'--verbosity',
|
|
35
|
-
type=int,
|
|
36
|
-
default=2,
|
|
37
|
-
help='Verbosity level (default: 2)'
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
parser.add_argument(
|
|
41
|
-
'--mode',
|
|
42
|
-
choices=['parallel', 'sequential'],
|
|
43
|
-
default='parallel',
|
|
44
|
-
help='Execution mode for tests (default: parallel)'
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
# Fail fast configuration
|
|
48
|
-
parser.add_argument(
|
|
49
|
-
'--fail_fast',
|
|
50
|
-
dest='fail_fast',
|
|
51
|
-
action='store_true',
|
|
52
|
-
help='Stop on first failure'
|
|
53
|
-
)
|
|
54
|
-
parser.add_argument(
|
|
55
|
-
'--no_fail_fast',
|
|
56
|
-
dest='fail_fast',
|
|
57
|
-
action='store_false',
|
|
58
|
-
help='Do not stop on first failure (default)'
|
|
59
|
-
)
|
|
60
|
-
parser.set_defaults(fail_fast=False)
|
|
61
|
-
|
|
62
|
-
# Print result configuration
|
|
63
|
-
parser.add_argument(
|
|
64
|
-
'--print_result',
|
|
65
|
-
dest='print_result',
|
|
66
|
-
action='store_true',
|
|
67
|
-
help='Print test results to console (default)'
|
|
68
|
-
)
|
|
69
|
-
parser.add_argument(
|
|
70
|
-
'--no_print_result',
|
|
71
|
-
dest='print_result',
|
|
72
|
-
action='store_false',
|
|
73
|
-
help='Do not print test results to console'
|
|
74
|
-
)
|
|
75
|
-
parser.set_defaults(print_result=True)
|
|
76
|
-
|
|
77
|
-
# Exception handling configuration
|
|
78
|
-
parser.add_argument(
|
|
79
|
-
'--throw_exception',
|
|
80
|
-
dest='throw_exception',
|
|
81
|
-
action='store_true',
|
|
82
|
-
help='Throw exception on test failure'
|
|
83
|
-
)
|
|
84
|
-
parser.add_argument(
|
|
85
|
-
'--no_throw_exception',
|
|
86
|
-
dest='throw_exception',
|
|
87
|
-
action='store_false',
|
|
88
|
-
help='Do not throw exception on test failure (default)'
|
|
89
|
-
)
|
|
90
|
-
parser.set_defaults(throw_exception=False)
|
|
91
|
-
|
|
92
|
-
# Persistent mode configuration
|
|
93
|
-
parser.add_argument(
|
|
94
|
-
'--persistent',
|
|
95
|
-
dest='persistent',
|
|
96
|
-
action='store_true',
|
|
97
|
-
help='Run tests in persistent mode'
|
|
98
|
-
)
|
|
99
|
-
parser.add_argument(
|
|
100
|
-
'--no_persistent',
|
|
101
|
-
dest='persistent',
|
|
102
|
-
action='store_false',
|
|
103
|
-
help='Do not run tests in persistent mode (default)'
|
|
104
|
-
)
|
|
105
|
-
parser.set_defaults(persistent=False)
|
|
106
|
-
|
|
107
|
-
parser.add_argument(
|
|
108
|
-
'--persistent_driver',
|
|
109
|
-
type=str,
|
|
110
|
-
default=None,
|
|
111
|
-
help='Persistent driver to use (default: None)'
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
# Web report configuration
|
|
115
|
-
parser.add_argument(
|
|
116
|
-
'--web_report',
|
|
117
|
-
dest='web_report',
|
|
118
|
-
action='store_true',
|
|
119
|
-
help='Generate web report'
|
|
120
|
-
)
|
|
121
|
-
parser.add_argument(
|
|
122
|
-
'--no_web_report',
|
|
123
|
-
dest='web_report',
|
|
124
|
-
action='store_false',
|
|
125
|
-
help='Do not generate web report (default)'
|
|
126
|
-
)
|
|
127
|
-
parser.set_defaults(web_report=False)
|
|
128
|
-
|
|
129
|
-
# Output buffer configuration
|
|
130
|
-
parser.add_argument(
|
|
131
|
-
'--print_output_buffer',
|
|
132
|
-
dest='print_output_buffer',
|
|
133
|
-
action='store_true',
|
|
134
|
-
help='Print output buffer (for CI integrations)'
|
|
135
|
-
)
|
|
136
|
-
parser.add_argument(
|
|
137
|
-
'--no_print_output_buffer',
|
|
138
|
-
dest='print_output_buffer',
|
|
139
|
-
action='store_false',
|
|
140
|
-
help='Do not print output buffer (default)'
|
|
141
|
-
)
|
|
142
|
-
parser.set_defaults(print_output_buffer=False)
|
|
143
|
-
|
|
144
|
-
return parser
|
|
145
|
-
|
|
146
|
-
def parse(
|
|
147
|
-
self,
|
|
148
|
-
sys_argv: list[str]
|
|
149
|
-
) -> TestArguments:
|
|
150
|
-
"""
|
|
151
|
-
Parse command line arguments from sys.argv and return TestArguments object.
|
|
152
|
-
|
|
153
|
-
Parameters
|
|
154
|
-
----------
|
|
155
|
-
sys_argv : list[str]
|
|
156
|
-
Command line arguments including script name. The script name (first element)
|
|
157
|
-
will be automatically removed before parsing.
|
|
158
|
-
|
|
159
|
-
Returns
|
|
160
|
-
-------
|
|
161
|
-
TestArguments
|
|
162
|
-
Parsed test arguments object.
|
|
163
|
-
"""
|
|
164
|
-
# Remove script name from sys.argv (first element)
|
|
165
|
-
args_only = sys_argv[1:] if len(sys_argv) > 0 else []
|
|
166
|
-
|
|
167
|
-
# Parse arguments and convert to TestArguments object
|
|
168
|
-
parsed_args = self.parser.parse_args(args_only)
|
|
169
|
-
|
|
170
|
-
# Create TestArguments instance from parsed arguments
|
|
171
|
-
return TestArguments(
|
|
172
|
-
verbosity=parsed_args.verbosity,
|
|
173
|
-
mode=parsed_args.mode,
|
|
174
|
-
fail_fast=parsed_args.fail_fast,
|
|
175
|
-
print_result=parsed_args.print_result,
|
|
176
|
-
throw_exception=parsed_args.throw_exception,
|
|
177
|
-
persistent=parsed_args.persistent,
|
|
178
|
-
persistent_driver=parsed_args.persistent_driver,
|
|
179
|
-
web_report=parsed_args.web_report,
|
|
180
|
-
print_output_buffer=parsed_args.print_output_buffer
|
|
181
|
-
)
|
|
182
|
-
|
|
183
|
-
def help(
|
|
184
|
-
self
|
|
185
|
-
) -> None:
|
|
186
|
-
"""Print help message for the test runner."""
|
|
187
|
-
self.parser.print_help()
|
orionis/test/contracts/parser.py
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from orionis.test.entities.arguments import TestArguments
|
|
3
|
-
|
|
4
|
-
class ITestArgumentParser(ABC):
|
|
5
|
-
"""
|
|
6
|
-
A parser class for handling test command-line arguments.
|
|
7
|
-
|
|
8
|
-
This class encapsulates the logic for creating and configuring the argument parser
|
|
9
|
-
for the Orionis test runner, providing a clean interface for parsing test arguments.
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
@abstractmethod
|
|
13
|
-
def parse(
|
|
14
|
-
self,
|
|
15
|
-
sys_argv: list[str]
|
|
16
|
-
) -> TestArguments:
|
|
17
|
-
"""
|
|
18
|
-
Parse command line arguments and return TestArguments object.
|
|
19
|
-
|
|
20
|
-
Parameters
|
|
21
|
-
----------
|
|
22
|
-
sys_argv : list[str]
|
|
23
|
-
Command line arguments including script name. The script name (first element)
|
|
24
|
-
will be automatically removed before parsing.
|
|
25
|
-
|
|
26
|
-
Returns
|
|
27
|
-
-------
|
|
28
|
-
TestArguments
|
|
29
|
-
Parsed test arguments object containing all configuration options for test execution.
|
|
30
|
-
|
|
31
|
-
Raises
|
|
32
|
-
------
|
|
33
|
-
SystemExit
|
|
34
|
-
If argument parsing fails or help is requested.
|
|
35
|
-
"""
|
|
36
|
-
pass
|
|
37
|
-
|
|
38
|
-
@abstractmethod
|
|
39
|
-
def help(
|
|
40
|
-
self
|
|
41
|
-
) -> None:
|
|
42
|
-
"""Print help message for the test runner."""
|
|
43
|
-
pass
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from typing import Literal, Optional
|
|
3
|
-
|
|
4
|
-
@dataclass
|
|
5
|
-
class TestArguments:
|
|
6
|
-
"""
|
|
7
|
-
Parameters for Orionis test execution.
|
|
8
|
-
|
|
9
|
-
Parameters
|
|
10
|
-
----------
|
|
11
|
-
verbosity : int, default=2
|
|
12
|
-
Level of test output verbosity.
|
|
13
|
-
mode : {'parallel', 'sequential'}, default='parallel'
|
|
14
|
-
Test execution mode. Whether to run tests in parallel or sequentially.
|
|
15
|
-
fail_fast : bool, default=False
|
|
16
|
-
If True, stop execution upon first test failure.
|
|
17
|
-
print_result : bool, default=True
|
|
18
|
-
If True, print test results to the console.
|
|
19
|
-
throw_exception : bool, default=False
|
|
20
|
-
If True, raise exceptions during test execution.
|
|
21
|
-
persistent : bool, default=False
|
|
22
|
-
If True, maintain state between test runs.
|
|
23
|
-
persistent_driver : str, optional
|
|
24
|
-
Driver to use for persistent test execution.
|
|
25
|
-
web_report : bool, default=False
|
|
26
|
-
If True, generate a web-based test report.
|
|
27
|
-
print_output_buffer : bool, default=False
|
|
28
|
-
If True, print the test output buffer.
|
|
29
|
-
"""
|
|
30
|
-
verbosity: int = 2
|
|
31
|
-
mode: Literal['parallel', 'sequential'] = 'parallel'
|
|
32
|
-
fail_fast: bool = False
|
|
33
|
-
print_result: bool = True
|
|
34
|
-
throw_exception: bool = False
|
|
35
|
-
persistent: bool = False
|
|
36
|
-
persistent_driver: Optional[str] = None
|
|
37
|
-
web_report: bool = False
|
|
38
|
-
print_output_buffer: bool = False
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
|
|
3
|
-
class ExecutionMode(Enum):
|
|
4
|
-
"""
|
|
5
|
-
ExecutionMode is an enumeration that defines the modes of execution
|
|
6
|
-
for a process or task.
|
|
7
|
-
|
|
8
|
-
Attributes
|
|
9
|
-
----------
|
|
10
|
-
SEQUENTIAL : str
|
|
11
|
-
Represents sequential execution mode, where tasks are executed one after another.
|
|
12
|
-
PARALLEL : str
|
|
13
|
-
Represents parallel execution mode, where tasks are executed concurrently.
|
|
14
|
-
"""
|
|
15
|
-
SEQUENTIAL = "sequential"
|
|
16
|
-
PARALLEL = "parallel"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|