orionis 0.454.0__py3-none-any.whl → 0.456.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/commands/help.py +36 -0
- orionis/console/contracts/reactor.py +39 -0
- orionis/console/core/reactor.py +7 -2
- orionis/console/kernel.py +78 -4
- orionis/foundation/application.py +3 -1
- orionis/foundation/providers/reactor_provider.py +93 -0
- orionis/foundation/providers/testing_provider.py +19 -67
- orionis/metadata/framework.py +1 -1
- orionis/test/contracts/unit_test.py +54 -0
- orionis/test/kernel.py +27 -1
- {orionis-0.454.0.dist-info → orionis-0.456.0.dist-info}/METADATA +1 -1
- {orionis-0.454.0.dist-info → orionis-0.456.0.dist-info}/RECORD +20 -17
- tests/services/introspection/dependencies/test_reflect_dependencies.py +7 -3
- tests/services/introspection/reflection/test_reflection_abstract.py +2 -11
- tests/services/introspection/reflection/test_reflection_concrete.py +2 -11
- tests/services/introspection/reflection/test_reflection_instance.py +2 -11
- {orionis-0.454.0.dist-info → orionis-0.456.0.dist-info}/WHEEL +0 -0
- {orionis-0.454.0.dist-info → orionis-0.456.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.454.0.dist-info → orionis-0.456.0.dist-info}/top_level.txt +0 -0
- {orionis-0.454.0.dist-info → orionis-0.456.0.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from orionis.console.base.command import BaseCommand
|
|
2
|
+
from orionis.console.exceptions import CLIOrionisRuntimeError
|
|
3
|
+
from rich.console import Console
|
|
4
|
+
from rich.panel import Panel
|
|
5
|
+
|
|
6
|
+
class HelpCommand(BaseCommand):
|
|
7
|
+
"""
|
|
8
|
+
Command class to display usage information for the Orionis CLI.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
timestamps: bool = False
|
|
12
|
+
signature: str = "help"
|
|
13
|
+
description: str = "Prints help information for the Orionis CLI commands."
|
|
14
|
+
|
|
15
|
+
def handle(self) -> None:
|
|
16
|
+
"""
|
|
17
|
+
Executes the command to display usage information for the Orionis CLI.
|
|
18
|
+
"""
|
|
19
|
+
try:
|
|
20
|
+
console = Console()
|
|
21
|
+
usage = (
|
|
22
|
+
"[bold cyan]Usage:[/]\n"
|
|
23
|
+
" orionis <command> [options]\n\n"
|
|
24
|
+
"[bold cyan]Available Commands:[/]\n"
|
|
25
|
+
" help Show this help message\n"
|
|
26
|
+
" run Run the application\n"
|
|
27
|
+
" make Generate code scaffolding\n"
|
|
28
|
+
" migrate Run database migrations\n"
|
|
29
|
+
" ... Other available commands\n\n"
|
|
30
|
+
"[bold cyan]Options:[/]\n"
|
|
31
|
+
" -h, --help Show this help message and exit\n"
|
|
32
|
+
)
|
|
33
|
+
panel = Panel(usage, title="[bold green]Orionis CLI Help[/]", expand=False, border_style="bright_blue")
|
|
34
|
+
console.print(panel)
|
|
35
|
+
except Exception as e:
|
|
36
|
+
raise CLIOrionisRuntimeError(f"An unexpected error occurred: {e}") from e
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import List, Optional
|
|
3
|
+
|
|
4
|
+
class IReactor(ABC):
|
|
5
|
+
|
|
6
|
+
@abstractmethod
|
|
7
|
+
def call(
|
|
8
|
+
self,
|
|
9
|
+
signature: str,
|
|
10
|
+
args: Optional[List[str]] = None
|
|
11
|
+
):
|
|
12
|
+
"""
|
|
13
|
+
Executes a command by its signature with optional command-line arguments.
|
|
14
|
+
|
|
15
|
+
This method retrieves a registered command by its signature, validates any provided
|
|
16
|
+
arguments against the command's argument parser, and executes the command's handle
|
|
17
|
+
method with the parsed arguments and application context.
|
|
18
|
+
|
|
19
|
+
Parameters
|
|
20
|
+
----------
|
|
21
|
+
signature : str
|
|
22
|
+
The unique signature identifier of the command to execute.
|
|
23
|
+
args : Optional[List[str]], default None
|
|
24
|
+
Command-line arguments to pass to the command. If None, no arguments are provided.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
None
|
|
29
|
+
This method does not return any value. The command's handle method is called
|
|
30
|
+
directly for execution.
|
|
31
|
+
|
|
32
|
+
Raises
|
|
33
|
+
------
|
|
34
|
+
ValueError
|
|
35
|
+
If the command with the specified signature is not found in the registry.
|
|
36
|
+
SystemExit
|
|
37
|
+
If argument parsing fails due to invalid arguments provided.
|
|
38
|
+
"""
|
|
39
|
+
pass
|
orionis/console/core/reactor.py
CHANGED
|
@@ -8,13 +8,14 @@ from orionis.app import Orionis
|
|
|
8
8
|
from orionis.console.args.argument import CLIArgument
|
|
9
9
|
from orionis.console.base.command import BaseCommand
|
|
10
10
|
from orionis.console.base.contracts.command import IBaseCommand
|
|
11
|
+
from orionis.console.contracts.reactor import IReactor
|
|
11
12
|
from orionis.console.output.contracts.console import IConsole
|
|
12
13
|
from orionis.console.output.contracts.executor import IExecutor
|
|
13
14
|
from orionis.foundation.contracts.application import IApplication
|
|
14
15
|
from orionis.services.introspection.modules.reflection import ReflectionModule
|
|
15
16
|
from orionis.services.log.contracts.log_service import ILogger
|
|
16
17
|
|
|
17
|
-
class Reactor:
|
|
18
|
+
class Reactor(IReactor):
|
|
18
19
|
|
|
19
20
|
def __init__(
|
|
20
21
|
self,
|
|
@@ -100,9 +101,13 @@ class Reactor:
|
|
|
100
101
|
|
|
101
102
|
# Import the core command class for version
|
|
102
103
|
from orionis.console.commands.version import VersionCommand
|
|
104
|
+
from orionis.console.commands.help import HelpCommand
|
|
103
105
|
|
|
104
106
|
# List of core command classes to load (extend this list as more core commands are added)
|
|
105
|
-
core_commands = [
|
|
107
|
+
core_commands = [
|
|
108
|
+
VersionCommand,
|
|
109
|
+
HelpCommand
|
|
110
|
+
]
|
|
106
111
|
|
|
107
112
|
# Iterate through the core command classes and register them
|
|
108
113
|
for obj in core_commands:
|
orionis/console/kernel.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from orionis.console.contracts.kernel import IKernelCLI
|
|
2
|
+
from orionis.console.contracts.reactor import IReactor
|
|
3
|
+
from orionis.console.output.contracts.console import IConsole
|
|
2
4
|
from orionis.foundation.contracts.application import IApplication
|
|
3
5
|
from orionis.console.exceptions import CLIOrionisValueError
|
|
4
6
|
|
|
@@ -8,6 +10,24 @@ class KernelCLI(IKernelCLI):
|
|
|
8
10
|
self,
|
|
9
11
|
app: IApplication
|
|
10
12
|
) -> None:
|
|
13
|
+
"""
|
|
14
|
+
Initializes the KernelCLI instance with the provided application container.
|
|
15
|
+
|
|
16
|
+
Parameters
|
|
17
|
+
----------
|
|
18
|
+
app : IApplication
|
|
19
|
+
The application container instance that provides access to services and dependencies.
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
None
|
|
24
|
+
This constructor does not return a value. It initializes internal dependencies required for CLI operations.
|
|
25
|
+
|
|
26
|
+
Raises
|
|
27
|
+
------
|
|
28
|
+
CLIOrionisValueError
|
|
29
|
+
If the provided `app` argument is not an instance of `IApplication`.
|
|
30
|
+
"""
|
|
11
31
|
|
|
12
32
|
# Validate that the app is an instance of IApplication
|
|
13
33
|
if not isinstance(app, IApplication):
|
|
@@ -15,11 +35,65 @@ class KernelCLI(IKernelCLI):
|
|
|
15
35
|
f"Failed to initialize TestKernel: expected IApplication, got {type(app).__module__}.{type(app).__name__}."
|
|
16
36
|
)
|
|
17
37
|
|
|
38
|
+
# Retrieve and initialize the reactor instance from the application container.
|
|
39
|
+
# The reactor is responsible for dispatching CLI commands.
|
|
40
|
+
self.__reactor: IReactor = app.make('x-orionis.console.core.reactor', app)
|
|
41
|
+
|
|
42
|
+
# Retrieve and initialize the console instance for command output and error handling.
|
|
43
|
+
self.__console: IConsole = app.make('x-orionis.console.output.console')
|
|
44
|
+
|
|
18
45
|
def handle(self, args: list) -> None:
|
|
19
46
|
"""
|
|
20
|
-
|
|
47
|
+
Processes and dispatches command line arguments to the appropriate command handler.
|
|
48
|
+
|
|
49
|
+
Parameters
|
|
50
|
+
----------
|
|
51
|
+
args : list
|
|
52
|
+
The list of command line arguments, typically `sys.argv`.
|
|
21
53
|
|
|
22
|
-
|
|
54
|
+
Returns
|
|
55
|
+
-------
|
|
56
|
+
None
|
|
57
|
+
This method does not return a value. It may terminate the process or delegate execution to command handlers.
|
|
58
|
+
|
|
59
|
+
Raises
|
|
60
|
+
------
|
|
61
|
+
SystemExit
|
|
62
|
+
If invalid arguments are provided or no command is specified, this method may terminate the process with an error message.
|
|
23
63
|
"""
|
|
24
|
-
|
|
25
|
-
|
|
64
|
+
|
|
65
|
+
try:
|
|
66
|
+
|
|
67
|
+
# Ensure the arguments are provided as a list
|
|
68
|
+
if not isinstance(args, list):
|
|
69
|
+
raise CLIOrionisValueError(
|
|
70
|
+
f"Failed to handle command line arguments: expected list, got {type(args).__module__}.{type(args).__name__}."
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
# If no arguments or only the script name is provided, show the default help command
|
|
74
|
+
if not args or len(args) <= 1:
|
|
75
|
+
return self.__reactor.call('help')
|
|
76
|
+
|
|
77
|
+
# Remove the first argument (script name) to process only the command and its parameters
|
|
78
|
+
args = args[1:]
|
|
79
|
+
|
|
80
|
+
# If no command is provided after removing the script name, exit with an error
|
|
81
|
+
if len(args) == 0:
|
|
82
|
+
raise CLIOrionisValueError("No command provided to execute.")
|
|
83
|
+
|
|
84
|
+
# If only the command is provided, call it without additional arguments
|
|
85
|
+
if len(args) == 1:
|
|
86
|
+
return self.__reactor.call(args[0])
|
|
87
|
+
|
|
88
|
+
# If command and arguments are provided, call the command with its arguments
|
|
89
|
+
return self.__reactor.call(args[0], args[1:])
|
|
90
|
+
|
|
91
|
+
except SystemExit as e:
|
|
92
|
+
|
|
93
|
+
# Handle SystemExit exceptions gracefully, allowing for clean exits with error messages
|
|
94
|
+
self.__console.exitError(str(e))
|
|
95
|
+
|
|
96
|
+
except Exception as e:
|
|
97
|
+
|
|
98
|
+
# Handle any other exceptions that may occur during command processing
|
|
99
|
+
self.__console.exitError(f"An unexpected error occurred: {str(e)}")
|
|
@@ -179,6 +179,7 @@ class Application(Container, IApplication):
|
|
|
179
179
|
from orionis.foundation.providers.testing_provider import TestingProvider
|
|
180
180
|
from orionis.foundation.providers.inspirational_provider import InspirationalProvider
|
|
181
181
|
from orionis.foundation.providers.executor_provider import ConsoleExecuteProvider
|
|
182
|
+
from orionis.foundation.providers.reactor_provider import ReactorProvider
|
|
182
183
|
|
|
183
184
|
# Core framework providers
|
|
184
185
|
core_providers = [
|
|
@@ -189,7 +190,8 @@ class Application(Container, IApplication):
|
|
|
189
190
|
LoggerProvider,
|
|
190
191
|
TestingProvider,
|
|
191
192
|
InspirationalProvider,
|
|
192
|
-
ConsoleExecuteProvider
|
|
193
|
+
ConsoleExecuteProvider,
|
|
194
|
+
ReactorProvider
|
|
193
195
|
]
|
|
194
196
|
|
|
195
197
|
# Register each core provider
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
from orionis.console.contracts.reactor import IReactor
|
|
2
|
+
from orionis.console.core.reactor import Reactor
|
|
3
|
+
from orionis.container.providers.service_provider import ServiceProvider
|
|
4
|
+
|
|
5
|
+
class ReactorProvider(ServiceProvider):
|
|
6
|
+
"""
|
|
7
|
+
Service provider for worker management functionality within the Orionis framework.
|
|
8
|
+
|
|
9
|
+
This provider is responsible for registering and configuring the worker management
|
|
10
|
+
service implementation in the application's dependency injection container. It
|
|
11
|
+
establishes the binding between the IReactor interface contract and its concrete
|
|
12
|
+
Reactor implementation, enabling consistent reactor operations throughout the
|
|
13
|
+
application lifecycle.
|
|
14
|
+
|
|
15
|
+
The provider follows the standard service provider pattern, offering both
|
|
16
|
+
registration and boot phases for complete service lifecycle management.
|
|
17
|
+
|
|
18
|
+
Attributes
|
|
19
|
+
----------
|
|
20
|
+
app : Application
|
|
21
|
+
The main application container instance used for service registration
|
|
22
|
+
and dependency injection management.
|
|
23
|
+
|
|
24
|
+
Notes
|
|
25
|
+
-----
|
|
26
|
+
This provider registers the reactor service with a transient lifetime, ensuring
|
|
27
|
+
that each request for reactor functionality receives a fresh instance. This
|
|
28
|
+
approach is optimal for operations that may maintain temporary state or require
|
|
29
|
+
isolation between different execution contexts.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
def register(self) -> None:
|
|
33
|
+
"""
|
|
34
|
+
Register the reactor management service in the application container.
|
|
35
|
+
|
|
36
|
+
This method binds the IReactor interface to a new instance of the Reactor
|
|
37
|
+
implementation within the application's dependency injection container. The
|
|
38
|
+
service is registered with a transient lifetime, ensuring that each resolution
|
|
39
|
+
yields a new Reactor instance. An alias is provided for convenient retrieval.
|
|
40
|
+
|
|
41
|
+
Parameters
|
|
42
|
+
----------
|
|
43
|
+
None
|
|
44
|
+
|
|
45
|
+
Returns
|
|
46
|
+
-------
|
|
47
|
+
None
|
|
48
|
+
This method does not return any value. It performs registration
|
|
49
|
+
as a side effect on the application container.
|
|
50
|
+
|
|
51
|
+
Notes
|
|
52
|
+
-----
|
|
53
|
+
- Each call to resolve IReactor will produce a new Reactor instance.
|
|
54
|
+
- No singleton or caching behavior is applied.
|
|
55
|
+
- The alias "x-orionis.console.core.reactor" can be used for explicit lookups.
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
# Register the Reactor service with the application container
|
|
59
|
+
# as a singleton, allowing it to be resolved throughout the application lifecycle
|
|
60
|
+
self.app.singleton(
|
|
61
|
+
IReactor,
|
|
62
|
+
Reactor,
|
|
63
|
+
alias="x-orionis.console.core.reactor"
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
def boot(self) -> None:
|
|
67
|
+
"""
|
|
68
|
+
Perform post-registration initialization for the reactor management service.
|
|
69
|
+
|
|
70
|
+
This method is invoked after all services have been registered in the container.
|
|
71
|
+
It provides an opportunity for additional setup, configuration, or initialization
|
|
72
|
+
logic that may depend on other services being available. Currently, this method
|
|
73
|
+
does not perform any actions but serves as a placeholder for future enhancements.
|
|
74
|
+
|
|
75
|
+
Parameters
|
|
76
|
+
----------
|
|
77
|
+
None
|
|
78
|
+
|
|
79
|
+
Returns
|
|
80
|
+
-------
|
|
81
|
+
None
|
|
82
|
+
This method does not return any value. It only performs initialization
|
|
83
|
+
side effects if required.
|
|
84
|
+
|
|
85
|
+
Notes
|
|
86
|
+
-----
|
|
87
|
+
- Called automatically during the application boot sequence.
|
|
88
|
+
- Intended for cross-service configuration or runtime setup.
|
|
89
|
+
- No initialization is currently required for the reactor service.
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
# No additional initialization required at this time
|
|
93
|
+
pass
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
from orionis.container.providers.service_provider import ServiceProvider
|
|
2
2
|
from orionis.test.contracts.unit_test import IUnitTest
|
|
3
3
|
from orionis.test.core.unit_test import UnitTest
|
|
4
|
-
from orionis.foundation.config.testing.entities.testing import Testing
|
|
5
|
-
import os
|
|
6
4
|
|
|
7
5
|
class TestingProvider(ServiceProvider):
|
|
8
6
|
"""
|
|
@@ -39,87 +37,41 @@ class TestingProvider(ServiceProvider):
|
|
|
39
37
|
|
|
40
38
|
def register(self) -> None:
|
|
41
39
|
"""
|
|
42
|
-
Register the unit testing service in the application container.
|
|
40
|
+
Register and configure the unit testing service in the application container.
|
|
43
41
|
|
|
44
|
-
This method
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
This method loads the testing configuration from the application, instantiates
|
|
43
|
+
and configures a UnitTest service, and registers it as a singleton in the
|
|
44
|
+
dependency injection container. The service is bound to the IUnitTest interface
|
|
45
|
+
and is accessible via the alias "x-orionis.test.core.unit_test".
|
|
48
46
|
|
|
49
47
|
The registration process includes:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
- Retrieving testing configuration from the application settings.
|
|
49
|
+
- Instantiating the UnitTest service with the appropriate configuration.
|
|
50
|
+
- Registering the UnitTest service as a singleton in the container.
|
|
51
|
+
- Binding the service to the IUnitTest interface and alias.
|
|
54
52
|
|
|
55
53
|
Returns
|
|
56
54
|
-------
|
|
57
55
|
None
|
|
58
56
|
This method does not return any value. It performs side effects by
|
|
59
|
-
registering the testing service in the application container.
|
|
57
|
+
registering and binding the testing service in the application container.
|
|
60
58
|
"""
|
|
61
59
|
|
|
62
|
-
#
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
# Instantiate the UnitTest implementation with application reference
|
|
66
|
-
unit_test = UnitTest(
|
|
67
|
-
app=self.app
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
# Apply configuration settings to the UnitTest instance
|
|
71
|
-
unit_test.configure(
|
|
72
|
-
verbosity=config.verbosity, # Set output verbosity level
|
|
73
|
-
execution_mode=config.execution_mode, # Configure test execution mode
|
|
74
|
-
max_workers=config.max_workers, # Set maximum worker threads for parallel execution
|
|
75
|
-
fail_fast=config.fail_fast, # Enable/disable fail-fast behavior
|
|
76
|
-
print_result=config.print_result, # Control result output printing
|
|
77
|
-
throw_exception=config.throw_exception, # Configure exception throwing behavior
|
|
78
|
-
persistent=config.persistent, # Enable/disable persistent test results
|
|
79
|
-
persistent_driver=config.persistent_driver, # Set persistent storage driver
|
|
80
|
-
web_report=config.web_report # Enable/disable web-based reporting
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
# Discover and load test files based on configuration criteria
|
|
84
|
-
unit_test.discoverTests(
|
|
85
|
-
base_path=config.base_path, # Root directory for test discovery
|
|
86
|
-
folder_path=config.folder_path, # Specific folder path within base_path
|
|
87
|
-
pattern=config.pattern, # File name pattern for test files
|
|
88
|
-
test_name_pattern=config.test_name_pattern, # Pattern for test method names
|
|
89
|
-
tags=config.tags # Tags to filter tests during discovery
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
# Register the configured UnitTest instance in the DI container
|
|
93
|
-
# Binds IUnitTest interface to the UnitTest implementation as a singleton
|
|
94
|
-
self.app.instance(IUnitTest, unit_test, alias="x-orionis.test.core.unit_test")
|
|
60
|
+
# Register the UnitTest service as a singleton in the application container.
|
|
61
|
+
# The service is bound to the IUnitTest interface and can be resolved using the alias.
|
|
62
|
+
self.app.singleton(IUnitTest, UnitTest, alias="x-orionis.test.core.unit_test")
|
|
95
63
|
|
|
96
64
|
def boot(self) -> None:
|
|
97
65
|
"""
|
|
98
|
-
|
|
66
|
+
Finalize initialization for the testing provider after service registration.
|
|
99
67
|
|
|
100
|
-
This method is called after the
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
and available before test execution begins.
|
|
104
|
-
|
|
105
|
-
The boot process includes:
|
|
106
|
-
- Creating the testing storage directory if it doesn't exist
|
|
107
|
-
- Setting appropriate permissions for the storage path
|
|
108
|
-
- Preparing the filesystem structure for test artifacts
|
|
68
|
+
This method is called after the registration phase to allow for any additional
|
|
69
|
+
setup required for the testing environment. In this implementation, no further
|
|
70
|
+
actions are performed during the boot phase.
|
|
109
71
|
|
|
110
72
|
Returns
|
|
111
73
|
-------
|
|
112
74
|
None
|
|
113
|
-
This method does not return any value.
|
|
114
|
-
side effects by creating required directories in the filesystem.
|
|
75
|
+
This method does not return any value.
|
|
115
76
|
"""
|
|
116
|
-
|
|
117
|
-
# Retrieve the configured storage path for testing artifacts and temporary files
|
|
118
|
-
storage_path = self.app.path('storage_testing')
|
|
119
|
-
|
|
120
|
-
# Check if the testing storage directory exists in the filesystem
|
|
121
|
-
if not os.path.exists(storage_path):
|
|
122
|
-
|
|
123
|
-
# Create the directory structure recursively, including parent directories
|
|
124
|
-
# exist_ok=True prevents errors if directory is created by another process
|
|
125
|
-
os.makedirs(storage_path, exist_ok=True)
|
|
77
|
+
pass
|
orionis/metadata/framework.py
CHANGED
|
@@ -52,6 +52,60 @@ class IUnitTest(ABC):
|
|
|
52
52
|
"""
|
|
53
53
|
pass
|
|
54
54
|
|
|
55
|
+
@abstractmethod
|
|
56
|
+
def discoverTests(
|
|
57
|
+
self,
|
|
58
|
+
base_path: str | Path,
|
|
59
|
+
folder_path: str | List[str],
|
|
60
|
+
pattern: str,
|
|
61
|
+
test_name_pattern: Optional[str] = None,
|
|
62
|
+
tags: Optional[List[str]] = None
|
|
63
|
+
) -> 'IUnitTest':
|
|
64
|
+
"""
|
|
65
|
+
Discover test cases from specified folders using flexible path discovery.
|
|
66
|
+
|
|
67
|
+
This method provides a convenient way to discover and load test cases from multiple folders
|
|
68
|
+
based on various path specifications. It supports wildcard discovery, single folder loading,
|
|
69
|
+
and multiple folder loading. The method automatically resolves paths relative to the base
|
|
70
|
+
directory and discovers all folders containing files matching the specified pattern.
|
|
71
|
+
|
|
72
|
+
Parameters
|
|
73
|
+
----------
|
|
74
|
+
base_path : str or Path
|
|
75
|
+
Base directory path for resolving relative folder paths. This serves as the root
|
|
76
|
+
directory from which all folder searches are conducted.
|
|
77
|
+
folder_path : str or list of str
|
|
78
|
+
Specification of folders to search for test cases. Can be:
|
|
79
|
+
- '*' : Discover all folders containing matching files within base_path
|
|
80
|
+
- str : Single folder path relative to base_path
|
|
81
|
+
- list of str : Multiple folder paths relative to base_path
|
|
82
|
+
pattern : str
|
|
83
|
+
File name pattern to match test files, supporting wildcards (* and ?).
|
|
84
|
+
Examples: 'test_*.py', '*_test.py', 'test*.py'
|
|
85
|
+
test_name_pattern : str, optional
|
|
86
|
+
Regular expression pattern to filter test method names. Only tests whose
|
|
87
|
+
names match this pattern will be included. Default is None (no filtering).
|
|
88
|
+
tags : list of str, optional
|
|
89
|
+
List of tags to filter tests. Only tests decorated with matching tags
|
|
90
|
+
will be included. Default is None (no tag filtering).
|
|
91
|
+
|
|
92
|
+
Returns
|
|
93
|
+
-------
|
|
94
|
+
UnitTest
|
|
95
|
+
The current UnitTest instance with discovered tests added to the suite,
|
|
96
|
+
enabling method chaining.
|
|
97
|
+
|
|
98
|
+
Notes
|
|
99
|
+
-----
|
|
100
|
+
- All paths are resolved as absolute paths relative to the base_path
|
|
101
|
+
- When folder_path is '*', the method searches recursively through all subdirectories
|
|
102
|
+
- The method uses the existing discoverTestsInFolder method for actual test discovery
|
|
103
|
+
- Duplicate folders are automatically eliminated using a set data structure
|
|
104
|
+
- The method does not validate the existence of specified folders; validation
|
|
105
|
+
occurs during the actual test discovery process
|
|
106
|
+
"""
|
|
107
|
+
pass
|
|
108
|
+
|
|
55
109
|
@abstractmethod
|
|
56
110
|
def discoverTestsInFolder(
|
|
57
111
|
self,
|
orionis/test/kernel.py
CHANGED
|
@@ -2,6 +2,7 @@ from orionis.console.output.contracts.console import IConsole
|
|
|
2
2
|
from orionis.foundation.contracts.application import IApplication
|
|
3
3
|
from orionis.test.contracts.kernel import ITestKernel
|
|
4
4
|
from orionis.test.contracts.unit_test import IUnitTest
|
|
5
|
+
from orionis.foundation.config.testing.entities.testing import Testing
|
|
5
6
|
from orionis.test.exceptions import OrionisTestConfigException, OrionisTestFailureException
|
|
6
7
|
|
|
7
8
|
class TestKernel(ITestKernel):
|
|
@@ -38,8 +39,33 @@ class TestKernel(ITestKernel):
|
|
|
38
39
|
f"Failed to initialize TestKernel: expected IApplication, got {type(app).__module__}.{type(app).__name__}."
|
|
39
40
|
)
|
|
40
41
|
|
|
42
|
+
# Load testing configuration from application config and create Testing instance
|
|
43
|
+
config = Testing(**app.config('testing'))
|
|
44
|
+
|
|
41
45
|
# Resolve the unit test service from the application container
|
|
42
|
-
self.__unit_test: IUnitTest = app.make('x-orionis.test.core.unit_test')
|
|
46
|
+
self.__unit_test: IUnitTest = app.make('x-orionis.test.core.unit_test', app)
|
|
47
|
+
|
|
48
|
+
# Apply configuration settings to the UnitTest instance
|
|
49
|
+
self.__unit_test.configure(
|
|
50
|
+
verbosity=config.verbosity, # Set output verbosity level
|
|
51
|
+
execution_mode=config.execution_mode, # Configure test execution mode
|
|
52
|
+
max_workers=config.max_workers, # Set maximum worker threads for parallel execution
|
|
53
|
+
fail_fast=config.fail_fast, # Enable/disable fail-fast behavior
|
|
54
|
+
print_result=config.print_result, # Control result output printing
|
|
55
|
+
throw_exception=config.throw_exception, # Configure exception throwing behavior
|
|
56
|
+
persistent=config.persistent, # Enable/disable persistent test results
|
|
57
|
+
persistent_driver=config.persistent_driver, # Set persistent storage driver
|
|
58
|
+
web_report=config.web_report # Enable/disable web-based reporting
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# Discover and load test files based on configuration criteria
|
|
62
|
+
self.__unit_test.discoverTests(
|
|
63
|
+
base_path=config.base_path, # Root directory for test discovery
|
|
64
|
+
folder_path=config.folder_path, # Specific folder path within base_path
|
|
65
|
+
pattern=config.pattern, # File name pattern for test files
|
|
66
|
+
test_name_pattern=config.test_name_pattern, # Pattern for test method names
|
|
67
|
+
tags=config.tags # Tags to filter tests during discovery
|
|
68
|
+
)
|
|
43
69
|
|
|
44
70
|
# Resolve the console service from the application container
|
|
45
71
|
self.__console: IConsole = app.make('x-orionis.console.output.console')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
orionis/app.py,sha256=b69fOzj2J8Aw5g0IldWZXixUDeeTO9vcHc_Njses9HU,603
|
|
3
3
|
orionis/console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
orionis/console/kernel.py,sha256=
|
|
4
|
+
orionis/console/kernel.py,sha256=NGiINJzYRpxjQslZeELxxySxI-tL_isRrUL0yn4uz5o,3942
|
|
5
5
|
orionis/console/args/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
orionis/console/args/argument.py,sha256=Is8Z8_kW4DvcK1nK1UU-sa6Pk0BeOdcRczCayW0ZVHc,20360
|
|
7
7
|
orionis/console/args/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -11,11 +11,13 @@ orionis/console/base/command.py,sha256=nasVPyKEvuv8sDFEWXhHyBCWAmSLfPPm2XlKaYYt_
|
|
|
11
11
|
orionis/console/base/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
orionis/console/base/contracts/command.py,sha256=vmAJD0yMQ5-AD_s9_xCFEAl64sKk65z7U2E196dALQM,5760
|
|
13
13
|
orionis/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
orionis/console/commands/help.py,sha256=EGg5FfWnLasi7I7gCTBLyvau6I0gVpc2ewNefyJlHeE,1494
|
|
14
15
|
orionis/console/commands/version.py,sha256=0neKUq7MulO0hLZyU9LLfIQYEaQtnm3faIjIfeK52V8,2886
|
|
15
16
|
orionis/console/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
17
|
orionis/console/contracts/kernel.py,sha256=mh4LlhEYHh3FuGZZQ0GBhD6ZLa5YQvaNj2r01IIHI5Y,826
|
|
18
|
+
orionis/console/contracts/reactor.py,sha256=fT49-794RI-y0ZhDyXf91VQoFdGx6kF1Kg-monJnj7s,1296
|
|
17
19
|
orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
orionis/console/core/reactor.py,sha256=
|
|
20
|
+
orionis/console/core/reactor.py,sha256=DoloMbAw7WojH38rSKmrRAArl8rWVb5J_p1YLepUMpc,21619
|
|
19
21
|
orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
22
|
orionis/console/dumper/dump.py,sha256=CATERiQ6XuIrKQsDaWcVxzTtlAJI9qLJX44fQxEX8ws,22443
|
|
21
23
|
orionis/console/dumper/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -69,7 +71,7 @@ orionis/container/validators/is_subclass.py,sha256=4sBaGLoRs8nUhuWjlP0VJqyTwVHYq
|
|
|
69
71
|
orionis/container/validators/is_valid_alias.py,sha256=4uAYcq8xov7jZbXnpKpjNkxcZtlTNnL5RRctVPMwJes,1424
|
|
70
72
|
orionis/container/validators/lifetime.py,sha256=IQ43fDNrxYHMlZH2zlYDJnlkLO_eS4U7Fs3UJgQBidI,1844
|
|
71
73
|
orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
|
-
orionis/foundation/application.py,sha256=
|
|
74
|
+
orionis/foundation/application.py,sha256=yZ1C92A2bTtWK4RUd9RSACLVQVBPjd6zElTt6_kjV6k,77026
|
|
73
75
|
orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
76
|
orionis/foundation/config/startup.py,sha256=vbzduprRCNyYeR2nnMaqc1uKXw6PTzAY2jVfXNQKN8I,9691
|
|
75
77
|
orionis/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -177,10 +179,11 @@ orionis/foundation/providers/executor_provider.py,sha256=kwkH8YWEXoEoP51akJXQJ0U
|
|
|
177
179
|
orionis/foundation/providers/inspirational_provider.py,sha256=uq2o0uLd5p6PR99uH4cJAcc6NnU6nIOwe0ZIdzZcF4Q,3726
|
|
178
180
|
orionis/foundation/providers/logger_provider.py,sha256=bEJug46TNNxuqfCI8eI-GSp0eyNromvBDszQGK-0roc,3607
|
|
179
181
|
orionis/foundation/providers/progress_bar_provider.py,sha256=X4Ke7mPr0MgVp6WDNaQ3bI3Z_LOS8qE-wid0MQErKms,3367
|
|
180
|
-
orionis/foundation/providers/
|
|
182
|
+
orionis/foundation/providers/reactor_provider.py,sha256=g7X5eyZviQkX2hD7jZof6h1hZmN8rNvODmhGFysfiEY,3712
|
|
183
|
+
orionis/foundation/providers/testing_provider.py,sha256=SrJRpdvcblx9WvX7x9Y3zc7OQfiTf7la0HAJrm2ESlE,3725
|
|
181
184
|
orionis/foundation/providers/workers_provider.py,sha256=5CvlUETdIblh7Wx8pT0MswTeTCGhYah-EvFqOrLu8Mo,4113
|
|
182
185
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
183
|
-
orionis/metadata/framework.py,sha256=
|
|
186
|
+
orionis/metadata/framework.py,sha256=F5pE_UIelgIj5tk73nlMNZoqHahNmXnoQAl4vkJJjmg,4088
|
|
184
187
|
orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
|
|
185
188
|
orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
186
189
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -298,7 +301,7 @@ orionis/support/standard/exceptions/value.py,sha256=rsyWFQweImaJGTJa7Id7RhPlwWJ4
|
|
|
298
301
|
orionis/support/wrapper/__init__.py,sha256=jGoWoIGYuRYqMYQKlrX7Dpcbg-AGkHoB_aM2xhu73yc,62
|
|
299
302
|
orionis/support/wrapper/dot_dict.py,sha256=T8xWwwOhBZHNeXRwE_CxvOwG9UFxsLqNmOJjV2CNIrc,7284
|
|
300
303
|
orionis/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
301
|
-
orionis/test/kernel.py,sha256=
|
|
304
|
+
orionis/test/kernel.py,sha256=iFJh72_YHPzQbeFyOJWU4R9vfWohfElLRU17Ak_Vhos,5024
|
|
302
305
|
orionis/test/cases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
303
306
|
orionis/test/cases/asynchronous.py,sha256=3e1Y3qzIxVU7i7lbLFEVyJ89IA74JsB7famx71W-p2E,1974
|
|
304
307
|
orionis/test/cases/synchronous.py,sha256=S5jhuDEZ5I9wosrTFaCtowkD5r5HzJH6mKPOdEJcDJE,1734
|
|
@@ -309,7 +312,7 @@ orionis/test/contracts/logs.py,sha256=kRH3TGQcTNI0kRxFyEs13Y7NOPP9x9WGitPexnoLzQ
|
|
|
309
312
|
orionis/test/contracts/printer.py,sha256=iBz8wHAGaS21VBsHlZQVcx0xu9Bqusb-CLAjj-R1Sjg,3412
|
|
310
313
|
orionis/test/contracts/render.py,sha256=wpDQzUtT0r8KFZ7zPcxWHXQ1EVNKxzA_rZ6ZKUcZO1c,744
|
|
311
314
|
orionis/test/contracts/test_result.py,sha256=SNXJ2UerkweYn7uCT0i0HmMGP0XBrL_9KJs-0ZvIYU4,4002
|
|
312
|
-
orionis/test/contracts/unit_test.py,sha256=
|
|
315
|
+
orionis/test/contracts/unit_test.py,sha256=getqaBoadQT_wh_V6aTQvm0yx9IgbVrE9EEOD8b031g,8031
|
|
313
316
|
orionis/test/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
314
317
|
orionis/test/core/unit_test.py,sha256=WU107nW5mhLZ8wluhtxkaBNuOKaqAb6BswpdQ-ozCXI,64834
|
|
315
318
|
orionis/test/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -345,7 +348,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
|
|
|
345
348
|
orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
|
|
346
349
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
347
350
|
orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
|
|
348
|
-
orionis-0.
|
|
351
|
+
orionis-0.456.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
|
|
349
352
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
350
353
|
tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
351
354
|
tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -441,16 +444,16 @@ tests/services/environment/test_services_environment.py,sha256=8gbF2vK238lracBip
|
|
|
441
444
|
tests/services/introspection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
442
445
|
tests/services/introspection/test_reflection.py,sha256=AaBi0zi7GphOqnagV8N48GZHUuoT7743Pw3oc6_As6I,13700
|
|
443
446
|
tests/services/introspection/dependencies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
444
|
-
tests/services/introspection/dependencies/test_reflect_dependencies.py,sha256=
|
|
447
|
+
tests/services/introspection/dependencies/test_reflect_dependencies.py,sha256=UJwASK4ItTehXvWMq75vIMxBWTg2euS105EgRaIkVic,13894
|
|
445
448
|
tests/services/introspection/dependencies/mocks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
446
449
|
tests/services/introspection/dependencies/mocks/mock_user.py,sha256=RxATxe0-Vm4HfX5jKz9Tny42E2fmrdtEN6ZEntbqRL8,912
|
|
447
450
|
tests/services/introspection/dependencies/mocks/mock_user_controller.py,sha256=Hu4Xys5HENpKaLqsEAjtp_C-M9y6ozmJ_-qmj3ZvK6c,1214
|
|
448
451
|
tests/services/introspection/dependencies/mocks/mock_users_permissions.py,sha256=oENXbS2qmQUudYSmnhB8fgHBqXZdbplplB-Y2nbx4hw,1388
|
|
449
452
|
tests/services/introspection/reflection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
450
|
-
tests/services/introspection/reflection/test_reflection_abstract.py,sha256=
|
|
453
|
+
tests/services/introspection/reflection/test_reflection_abstract.py,sha256=MG243SrYBCaRHI85ifQE2t_Dwuy5LQdVAS4mrS3_n8E,41778
|
|
451
454
|
tests/services/introspection/reflection/test_reflection_callable.py,sha256=OVu4FmzkfVBbDrjWqrrq-1eqe9myNGygNpmtyCnu9hs,6817
|
|
452
|
-
tests/services/introspection/reflection/test_reflection_concrete.py,sha256=
|
|
453
|
-
tests/services/introspection/reflection/test_reflection_instance.py,sha256=
|
|
455
|
+
tests/services/introspection/reflection/test_reflection_concrete.py,sha256=7L4QTae1mDCujMZ0vvI4qsoTQxnRkeIuv3cXRdbISuc,38441
|
|
456
|
+
tests/services/introspection/reflection/test_reflection_instance.py,sha256=IpYm45S9kaGXGvkCIrnwAVxN-mtL1QUd7iV9niUpmTQ,57397
|
|
454
457
|
tests/services/introspection/reflection/test_reflection_module.py,sha256=a4sjSHeKADHUO5FvSDg1wPYNGfO385JZxSCoIqjfuZE,24608
|
|
455
458
|
tests/services/introspection/reflection/mock/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
456
459
|
tests/services/introspection/reflection/mock/fake_reflect_instance.py,sha256=iMf_yKgk0Y91XUHhRcl2qw7Z83QeNspvLi_tl4Dp-rI,28032
|
|
@@ -488,8 +491,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
488
491
|
tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
|
|
489
492
|
tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
490
493
|
tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
|
|
491
|
-
orionis-0.
|
|
492
|
-
orionis-0.
|
|
493
|
-
orionis-0.
|
|
494
|
-
orionis-0.
|
|
495
|
-
orionis-0.
|
|
494
|
+
orionis-0.456.0.dist-info/METADATA,sha256=CuJ0cT18-oNIn-451hxfWvnoA4an7SVDx3Lv9uTvSY4,4772
|
|
495
|
+
orionis-0.456.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
496
|
+
orionis-0.456.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
|
497
|
+
orionis-0.456.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
498
|
+
orionis-0.456.0.dist-info/RECORD,,
|
|
@@ -170,7 +170,7 @@ class TestReflectDependencies(AsyncTestCase):
|
|
|
170
170
|
self.assertEqual(dep_user_permissions.type, FakeUserWithPermissions)
|
|
171
171
|
|
|
172
172
|
# Extract and validate the 'permissions' dependency (built-in generic type)
|
|
173
|
-
dep_permissions: Argument = method_dependencies.
|
|
173
|
+
dep_permissions: Argument = method_dependencies.unresolved.get('permissions')
|
|
174
174
|
|
|
175
175
|
# Ensure the built-in type dependency is properly resolved as an Argument instance
|
|
176
176
|
self.assertIsInstance(dep_permissions, Argument)
|
|
@@ -248,10 +248,14 @@ class TestReflectDependencies(AsyncTestCase):
|
|
|
248
248
|
dep_x: Argument = callable_dependencies.resolved.get('x')
|
|
249
249
|
|
|
250
250
|
# Verify that the 'x' parameter resolves to its default value of 3
|
|
251
|
-
self.
|
|
251
|
+
self.assertIsInstance(dep_x, Argument)
|
|
252
|
+
self.assertTrue(dep_x.resolved)
|
|
253
|
+
self.assertEqual(dep_x.default, 3)
|
|
252
254
|
|
|
253
255
|
# Extract and validate the 'y' parameter dependency from resolved dependencies
|
|
254
256
|
dep_y: Argument = callable_dependencies.resolved.get('y')
|
|
255
257
|
|
|
256
258
|
# Verify that the 'y' parameter resolves to its default value of 4
|
|
257
|
-
self.
|
|
259
|
+
self.assertIsInstance(dep_y, Argument)
|
|
260
|
+
self.assertTrue(dep_y.resolved)
|
|
261
|
+
self.assertEqual(dep_y.default, 4)
|
|
@@ -1007,14 +1007,5 @@ class TestServiceReflectionAbstract(AsyncTestCase):
|
|
|
1007
1007
|
"""
|
|
1008
1008
|
reflect = ReflectionAbstract(AbstractFakeClass)
|
|
1009
1009
|
method_deps: ResolveArguments = reflect.getMethodDependencies('instanceSyncMethod')
|
|
1010
|
-
self.assertIn('x', method_deps.
|
|
1011
|
-
self.assertIn('y', method_deps.
|
|
1012
|
-
self.assertEqual(method_deps.resolved['x'].class_name, 'int')
|
|
1013
|
-
self.assertEqual(method_deps.resolved['y'].class_name, 'int')
|
|
1014
|
-
self.assertEqual(method_deps.resolved['x'].module_name, 'builtins')
|
|
1015
|
-
self.assertEqual(method_deps.resolved['y'].module_name, 'builtins')
|
|
1016
|
-
self.assertEqual(method_deps.resolved['x'].type, int)
|
|
1017
|
-
self.assertEqual(method_deps.resolved['y'].type, int)
|
|
1018
|
-
self.assertEqual(method_deps.resolved['x'].full_class_path, 'builtins.int')
|
|
1019
|
-
self.assertEqual(method_deps.resolved['y'].full_class_path, 'builtins.int')
|
|
1020
|
-
self.assertEqual(method_deps.unresolved, [])
|
|
1010
|
+
self.assertIn('x', method_deps.unresolved)
|
|
1011
|
+
self.assertIn('y', method_deps.unresolved)
|
|
@@ -948,14 +948,5 @@ class TestServiceReflectionConcrete(AsyncTestCase):
|
|
|
948
948
|
"""
|
|
949
949
|
reflect = ReflectionConcrete(FakeClass)
|
|
950
950
|
method_deps: ResolveArguments = reflect.getMethodDependencies('instanceSyncMethod')
|
|
951
|
-
self.assertIn('x', method_deps.
|
|
952
|
-
self.assertIn('y', method_deps.
|
|
953
|
-
self.assertEqual(method_deps.resolved['x'].class_name, 'int')
|
|
954
|
-
self.assertEqual(method_deps.resolved['y'].class_name, 'int')
|
|
955
|
-
self.assertEqual(method_deps.resolved['x'].module_name, 'builtins')
|
|
956
|
-
self.assertEqual(method_deps.resolved['y'].module_name, 'builtins')
|
|
957
|
-
self.assertEqual(method_deps.resolved['x'].type, int)
|
|
958
|
-
self.assertEqual(method_deps.resolved['y'].type, int)
|
|
959
|
-
self.assertEqual(method_deps.resolved['x'].full_class_path, 'builtins.int')
|
|
960
|
-
self.assertEqual(method_deps.resolved['y'].full_class_path, 'builtins.int')
|
|
961
|
-
self.assertEqual(method_deps.unresolved, [])
|
|
951
|
+
self.assertIn('x', method_deps.unresolved)
|
|
952
|
+
self.assertIn('y', method_deps.unresolved)
|
|
@@ -1229,14 +1229,5 @@ class TestServiceReflectionInstance(AsyncTestCase):
|
|
|
1229
1229
|
"""
|
|
1230
1230
|
reflect = ReflectionInstance(FakeClass())
|
|
1231
1231
|
method_deps: ResolveArguments = reflect.getMethodDependencies('instanceSyncMethod')
|
|
1232
|
-
self.assertIn('x', method_deps.
|
|
1233
|
-
self.assertIn('y', method_deps.
|
|
1234
|
-
self.assertEqual(method_deps.resolved['x'].class_name, 'int')
|
|
1235
|
-
self.assertEqual(method_deps.resolved['y'].class_name, 'int')
|
|
1236
|
-
self.assertEqual(method_deps.resolved['x'].module_name, 'builtins')
|
|
1237
|
-
self.assertEqual(method_deps.resolved['y'].module_name, 'builtins')
|
|
1238
|
-
self.assertEqual(method_deps.resolved['x'].type, int)
|
|
1239
|
-
self.assertEqual(method_deps.resolved['y'].type, int)
|
|
1240
|
-
self.assertEqual(method_deps.resolved['x'].full_class_path, 'builtins.int')
|
|
1241
|
-
self.assertEqual(method_deps.resolved['y'].full_class_path, 'builtins.int')
|
|
1242
|
-
self.assertEqual(method_deps.unresolved, [])
|
|
1232
|
+
self.assertIn('x', method_deps.unresolved)
|
|
1233
|
+
self.assertIn('y', method_deps.unresolved)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|