orionis 0.371.0__py3-none-any.whl → 0.373.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/__init__.py +9 -0
- orionis/container/resolver/resolver.py +3 -3
- orionis/foundation/application.py +66 -31
- orionis/foundation/contracts/application.py +1 -1
- orionis/metadata/framework.py +1 -1
- orionis/services/introspection/dependencies/entities/callable_dependencies.py +6 -6
- orionis/services/introspection/dependencies/entities/class_dependencies.py +7 -7
- orionis/services/introspection/dependencies/entities/{resolved_dependencies.py → known_dependencies.py} +1 -1
- orionis/services/introspection/dependencies/entities/method_dependencies.py +6 -6
- orionis/services/introspection/dependencies/reflection.py +4 -4
- orionis/test/arguments/parser.py +197 -0
- orionis/test/cases/asynchronous.py +145 -0
- orionis/test/cases/synchronous.py +135 -0
- orionis/test/contracts/kernel.py +99 -0
- orionis/test/contracts/logs.py +125 -0
- orionis/test/contracts/parser.py +37 -0
- orionis/test/contracts/render.py +30 -0
- orionis/test/contracts/unit_test.py +21 -0
- orionis/test/core/unit_test.py +104 -23
- orionis/test/entities/arguments.py +38 -0
- orionis/test/kernel.py +276 -0
- orionis/test/output/dumper.py +3 -4
- orionis/test/output/printer.py +22 -0
- orionis/test/{logs → record}/history.py +25 -9
- orionis/test/records/__init__.py +0 -0
- orionis/test/records/logs.py +385 -0
- orionis/test/view/render.py +8 -5
- {orionis-0.371.0.dist-info → orionis-0.373.0.dist-info}/METADATA +1 -1
- {orionis-0.371.0.dist-info → orionis-0.373.0.dist-info}/RECORD +93 -88
- tests/example/test_example.py +4 -3
- tests/foundation/config/app/test_foundation_config_app.py +2 -2
- tests/foundation/config/auth/test_foundation_config_auth.py +2 -2
- tests/foundation/config/cache/test_foundation_config_cache.py +2 -2
- tests/foundation/config/cache/test_foundation_config_cache_file.py +2 -2
- tests/foundation/config/cache/test_foundation_config_cache_stores.py +2 -2
- tests/foundation/config/cors/test_foundation_config_cors.py +2 -2
- tests/foundation/config/database/test_foundation_config_database.py +2 -2
- tests/foundation/config/database/test_foundation_config_database_connections.py +2 -2
- tests/foundation/config/database/test_foundation_config_database_mysql.py +2 -2
- tests/foundation/config/database/test_foundation_config_database_oracle.py +2 -2
- tests/foundation/config/database/test_foundation_config_database_pgsql.py +2 -2
- tests/foundation/config/database/test_foundation_config_database_sqlite.py +2 -2
- tests/foundation/config/filesystems/test_foundation_config_filesystems.py +2 -2
- tests/foundation/config/filesystems/test_foundation_config_filesystems_aws.py +2 -2
- tests/foundation/config/filesystems/test_foundation_config_filesystems_disks.py +2 -2
- tests/foundation/config/filesystems/test_foundation_config_filesystems_local.py +2 -2
- tests/foundation/config/filesystems/test_foundation_config_filesystems_public.py +2 -2
- tests/foundation/config/logging/test_foundation_config_logging.py +2 -2
- tests/foundation/config/logging/test_foundation_config_logging_channels.py +2 -2
- tests/foundation/config/logging/test_foundation_config_logging_chunked.py +2 -2
- tests/foundation/config/logging/test_foundation_config_logging_daily.py +2 -2
- tests/foundation/config/logging/test_foundation_config_logging_hourly.py +2 -2
- tests/foundation/config/logging/test_foundation_config_logging_monthly.py +2 -2
- tests/foundation/config/logging/test_foundation_config_logging_stack.py +2 -2
- tests/foundation/config/logging/test_foundation_config_logging_weekly.py +2 -2
- tests/foundation/config/mail/test_foundation_config_mail.py +2 -2
- tests/foundation/config/mail/test_foundation_config_mail_file.py +2 -2
- tests/foundation/config/mail/test_foundation_config_mail_mailers.py +2 -2
- tests/foundation/config/mail/test_foundation_config_mail_smtp.py +2 -2
- tests/foundation/config/queue/test_foundation_config_queue.py +2 -5
- tests/foundation/config/queue/test_foundation_config_queue_brokers.py +2 -2
- tests/foundation/config/queue/test_foundation_config_queue_database.py +3 -2
- tests/foundation/config/root/test_foundation_config_root_paths.py +3 -3
- tests/foundation/config/session/test_foundation_config_session.py +4 -3
- tests/foundation/config/startup/test_foundation_config_startup.py +4 -3
- tests/foundation/config/testing/test_foundation_config_testing.py +3 -3
- tests/foundation/exceptions/test_foundation_config_exceptions.py +3 -3
- tests/metadata/test_metadata_framework.py +2 -2
- tests/metadata/test_metadata_package.py +3 -2
- tests/services/asynchrony/test_services_asynchrony_coroutine.py +2 -2
- tests/services/environment/test_services_environment.py +2 -2
- tests/services/inspection/dependencies/test_reflect_dependencies.py +22 -22
- tests/services/inspection/reflection/test_reflection_abstract.py +2 -2
- tests/services/inspection/reflection/test_reflection_callable.py +2 -2
- tests/services/inspection/reflection/test_reflection_concrete.py +2 -2
- tests/services/inspection/reflection/test_reflection_instance.py +2 -2
- tests/services/inspection/reflection/test_reflection_module.py +2 -2
- tests/services/inspection/test_reflection.py +2 -2
- tests/services/path/test_services_resolver.py +2 -2
- tests/services/system/test_services_system_imports.py +2 -2
- tests/services/system/test_services_system_workers.py +3 -2
- tests/support/parsers/test_services_parser_exceptions.py +2 -2
- tests/support/patterns/singleton/test_patterns_singleton.py +2 -2
- tests/support/standard/test_services_std.py +2 -2
- tests/support/wrapper/test_services_wrapper_docdict.py +2 -2
- tests/testing/test_testing_result.py +4 -6
- tests/testing/test_testing_unit.py +9 -10
- orionis/test/cases/test_async.py +0 -55
- orionis/test/cases/test_case.py +0 -42
- orionis/test/cases/test_sync.py +0 -33
- orionis/test/contracts/history.py +0 -54
- orionis/test/test_suite.py +0 -142
- orionis/unittesting.py +0 -64
- /orionis/test/{logs → arguments}/__init__.py +0 -0
- /orionis/test/entities/{test_result.py → result.py} +0 -0
- {orionis-0.371.0.dist-info → orionis-0.373.0.dist-info}/WHEEL +0 -0
- {orionis-0.371.0.dist-info → orionis-0.373.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.371.0.dist-info → orionis-0.373.0.dist-info}/top_level.txt +0 -0
- {orionis-0.371.0.dist-info → orionis-0.373.0.dist-info}/zip-safe +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.foundation.config.logging.entities.monthly import Monthly
|
|
2
2
|
from orionis.foundation.config.logging.enums.levels import Level
|
|
3
3
|
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestFoundationConfigLoggingMonthly(
|
|
6
|
+
class TestFoundationConfigLoggingMonthly(AsyncTestCase):
|
|
7
7
|
"""
|
|
8
8
|
Test cases for the Monthly logging configuration class.
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.foundation.config.logging.entities.stack import Stack
|
|
2
2
|
from orionis.foundation.config.logging.enums.levels import Level
|
|
3
3
|
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestFoundationConfigLoggingStack(
|
|
6
|
+
class TestFoundationConfigLoggingStack(AsyncTestCase):
|
|
7
7
|
"""
|
|
8
8
|
Test cases for the Stack logging configuration class.
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.foundation.config.logging.entities.weekly import Weekly
|
|
2
2
|
from orionis.foundation.config.logging.enums.levels import Level
|
|
3
3
|
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestFoundationConfigLoggingWeekly(
|
|
6
|
+
class TestFoundationConfigLoggingWeekly(AsyncTestCase):
|
|
7
7
|
"""
|
|
8
8
|
Test cases for the Weekly logging configuration class.
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.foundation.config.mail.entities.mail import Mail
|
|
2
2
|
from orionis.foundation.config.mail.entities.mailers import Mailers
|
|
3
3
|
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestFoundationConfigMail(
|
|
6
|
+
class TestFoundationConfigMail(AsyncTestCase):
|
|
7
7
|
"""
|
|
8
8
|
Test suite for the Mail class, covering initialization, validation, and utility methods.
|
|
9
9
|
"""
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from orionis.foundation.config.mail.entities.file import File
|
|
2
2
|
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
|
3
|
-
from orionis.
|
|
3
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
4
4
|
|
|
5
|
-
class TestFoundationConfigMailFile(
|
|
5
|
+
class TestFoundationConfigMailFile(AsyncTestCase):
|
|
6
6
|
"""
|
|
7
7
|
Unit tests for the File entity in the mail configuration module.
|
|
8
8
|
"""
|
|
@@ -2,9 +2,9 @@ from orionis.foundation.config.mail.entities.mailers import Mailers
|
|
|
2
2
|
from orionis.foundation.config.mail.entities.smtp import Smtp
|
|
3
3
|
from orionis.foundation.config.mail.entities.file import File
|
|
4
4
|
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
|
5
|
-
from orionis.
|
|
5
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
6
6
|
|
|
7
|
-
class TestFoundationConfigMailMailers(
|
|
7
|
+
class TestFoundationConfigMailMailers(AsyncTestCase):
|
|
8
8
|
"""
|
|
9
9
|
Unit tests for the Mailers class.
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from orionis.foundation.config.mail.entities.smtp import Smtp
|
|
2
2
|
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
|
3
|
-
from orionis.
|
|
3
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
4
4
|
|
|
5
|
-
class TestFoundationConfigMailSmtp(
|
|
5
|
+
class TestFoundationConfigMailSmtp(AsyncTestCase):
|
|
6
6
|
"""
|
|
7
7
|
Unit tests for the Smtp configuration entity.
|
|
8
8
|
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
from orionis.foundation.config.queue.entities.queue import Queue
|
|
2
2
|
from orionis.foundation.config.queue.entities.brokers import Brokers
|
|
3
3
|
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestFoundationConfigQueue(
|
|
7
|
-
"""
|
|
8
|
-
Test suite for the Queue class.
|
|
9
|
-
"""
|
|
6
|
+
class TestFoundationConfigQueue(AsyncTestCase):
|
|
10
7
|
|
|
11
8
|
async def testDefaultInitialization(self):
|
|
12
9
|
"""
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.foundation.config.queue.entities.brokers import Brokers
|
|
2
2
|
from orionis.foundation.config.queue.entities.database import Database
|
|
3
3
|
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestFoundationConfigQueueBrokers(
|
|
6
|
+
class TestFoundationConfigQueueBrokers(AsyncTestCase):
|
|
7
7
|
async def testDefaultInitialization(self):
|
|
8
8
|
"""
|
|
9
9
|
Test that Brokers instance is initialized with correct default values.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
from orionis.foundation.config.queue.entities.database import Database
|
|
2
2
|
from orionis.foundation.config.queue.enums.strategy import Strategy
|
|
3
3
|
from orionis.foundation.exceptions.integrity import OrionisIntegrityException
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
|
+
|
|
6
|
+
class TestFoundationConfigQueueDatabase(AsyncTestCase):
|
|
5
7
|
|
|
6
|
-
class TestFoundationConfigQueueDatabase(TestCase):
|
|
7
8
|
async def testDefaultInitialization(self):
|
|
8
9
|
"""
|
|
9
10
|
Test default initialization of Database.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
-
from orionis.foundation.exceptions
|
|
2
|
+
from orionis.foundation.exceptions import OrionisIntegrityException
|
|
3
3
|
from orionis.foundation.config.roots.paths import Paths
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestFoundationConfigRootPaths(
|
|
6
|
+
class TestFoundationConfigRootPaths(AsyncTestCase):
|
|
7
7
|
"""
|
|
8
8
|
Test suite for the Paths dataclass which defines the project directory structure.
|
|
9
9
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
from orionis.foundation.config.session.entities.session import Session
|
|
2
2
|
from orionis.foundation.config.session.enums.same_site_policy import SameSitePolicy
|
|
3
|
-
from orionis.foundation.exceptions
|
|
4
|
-
from orionis.
|
|
3
|
+
from orionis.foundation.exceptions import OrionisIntegrityException
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
|
+
|
|
6
|
+
class TestFoundationConfigSession(AsyncTestCase):
|
|
5
7
|
|
|
6
|
-
class TestFoundationConfigSession(TestCase):
|
|
7
8
|
async def testDefaultInitialization(self):
|
|
8
9
|
"""
|
|
9
10
|
Test that Session instance is initialized with correct default values.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
from dataclasses import is_dataclass
|
|
2
|
-
from orionis.foundation.exceptions
|
|
2
|
+
from orionis.foundation.exceptions import OrionisIntegrityException
|
|
3
3
|
from orionis.foundation.config.startup import Configuration
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
|
+
from unittest.mock import Mock
|
|
5
6
|
|
|
6
|
-
class TestFoundationConfigStartup(
|
|
7
|
+
class TestFoundationConfigStartup(AsyncTestCase):
|
|
7
8
|
"""
|
|
8
9
|
Test suite for the Configuration dataclass.
|
|
9
10
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.foundation.config.testing.entities.testing import Testing
|
|
2
|
-
from orionis.foundation.exceptions
|
|
2
|
+
from orionis.foundation.exceptions import OrionisIntegrityException
|
|
3
3
|
from orionis.test.enums.execution_mode import ExecutionMode
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestFoundationConfigTesting(
|
|
6
|
+
class TestFoundationConfigTesting(AsyncTestCase):
|
|
7
7
|
"""
|
|
8
8
|
Test suite for the Testing configuration entity.
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
from orionis.foundation.exceptions
|
|
2
|
-
from orionis.
|
|
1
|
+
from orionis.foundation.exceptions import OrionisIntegrityException
|
|
2
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
3
3
|
|
|
4
|
-
class TestFoundationConfigExceptions(
|
|
4
|
+
class TestFoundationConfigExceptions(AsyncTestCase):
|
|
5
5
|
"""
|
|
6
6
|
Test cases for the OrionisIntegrityException class.
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from orionis.metadata.framework import *
|
|
2
|
-
from orionis.test.cases.
|
|
2
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
3
3
|
|
|
4
|
-
class TestMetadataFramework(
|
|
4
|
+
class TestMetadataFramework(AsyncTestCase):
|
|
5
5
|
"""
|
|
6
6
|
Test cases for the metadata constants and utility functions in orionis.metadata.framework.
|
|
7
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
from orionis.
|
|
1
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
2
|
+
from unittest.mock import patch
|
|
2
3
|
|
|
3
|
-
class TestPypiPackageApi(
|
|
4
|
+
class TestPypiPackageApi(AsyncTestCase):
|
|
4
5
|
|
|
5
6
|
@patch("orionis.metadata.package.PypiPackageApi")
|
|
6
7
|
async def testGetName(self, MockPypiPackageApi):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
from orionis.services.asynchrony.coroutines import Coroutine
|
|
3
3
|
from orionis.services.asynchrony.exceptions import OrionisCoroutineException
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestServicesAsynchronyCoroutine(
|
|
6
|
+
class TestServicesAsynchronyCoroutine(AsyncTestCase):
|
|
7
7
|
|
|
8
8
|
async def testExecuteWithActiveEventLoop(self):
|
|
9
9
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from orionis.services.environment.env import Env
|
|
2
|
-
from orionis.
|
|
2
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
3
3
|
|
|
4
|
-
class TestServicesEnvironment(
|
|
4
|
+
class TestServicesEnvironment(AsyncTestCase):
|
|
5
5
|
|
|
6
6
|
async def testSetAndGetConstants(self):
|
|
7
7
|
"""
|
|
@@ -4,23 +4,23 @@ from orionis.services.introspection.dependencies.reflection import (
|
|
|
4
4
|
ReflectDependencies,
|
|
5
5
|
ClassDependency,
|
|
6
6
|
MethodDependency,
|
|
7
|
-
|
|
7
|
+
KnownDependency
|
|
8
8
|
)
|
|
9
|
-
from orionis.
|
|
9
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
10
10
|
from tests.services.inspection.dependencies.mocks.mock_user import FakeUser
|
|
11
11
|
from tests.services.inspection.dependencies.mocks.mock_user_controller import UserController
|
|
12
12
|
from tests.services.inspection.dependencies.mocks.mock_users_permissions import FakeUserWithPermissions
|
|
13
13
|
|
|
14
|
-
class TestReflectDependencies(
|
|
14
|
+
class TestReflectDependencies(AsyncTestCase):
|
|
15
15
|
"""
|
|
16
16
|
Test suite for verifying the functionality of the ReflectDependencies class in resolving and reflecting dependencies for class constructors and methods.
|
|
17
17
|
This test class covers:
|
|
18
18
|
- Retrieval and resolution of constructor dependencies for the UserController class.
|
|
19
19
|
- Validation that constructor dependencies are correctly identified as instances of ClassDependency.
|
|
20
|
-
- Verification that resolved dependencies (such as 'user_repository') are instances of
|
|
20
|
+
- Verification that resolved dependencies (such as 'user_repository') are instances of KnownDependency and have the expected module name, class name, full class path, and type.
|
|
21
21
|
- Reflection and resolution of method dependencies for specific methods (e.g., 'createUserWithPermissions').
|
|
22
22
|
- Validation that method dependencies are correctly identified as instances of MethodDependency.
|
|
23
|
-
- Verification that resolved method dependencies (such as 'user_permissions' and 'permissions') are instances of
|
|
23
|
+
- Verification that resolved method dependencies (such as 'user_permissions' and 'permissions') are instances of KnownDependency and have the expected attributes.
|
|
24
24
|
- Ensuring that unresolved dependencies lists are empty where appropriate.
|
|
25
25
|
"""
|
|
26
26
|
|
|
@@ -30,7 +30,7 @@ class TestReflectDependencies(TestCase):
|
|
|
30
30
|
This test verifies:
|
|
31
31
|
- The returned constructor dependencies are an instance of ClassDependency.
|
|
32
32
|
- The list of unresolved dependencies is empty.
|
|
33
|
-
- The 'user_repository' dependency is resolved as an instance of
|
|
33
|
+
- The 'user_repository' dependency is resolved as an instance of KnownDependency.
|
|
34
34
|
- The resolved dependency for 'user_repository' has the expected module name, class name, full class path, and type (FakeUser).
|
|
35
35
|
"""
|
|
36
36
|
|
|
@@ -42,12 +42,12 @@ class TestReflectDependencies(TestCase):
|
|
|
42
42
|
|
|
43
43
|
self.assertEqual(constructor_dependencies.unresolved, [])
|
|
44
44
|
|
|
45
|
-
# Check Instance of
|
|
45
|
+
# Check Instance of KnownDependency
|
|
46
46
|
dep_user_repository = constructor_dependencies.resolved.get('user_repository')
|
|
47
|
-
self.assertIsInstance(dep_user_repository,
|
|
47
|
+
self.assertIsInstance(dep_user_repository, KnownDependency)
|
|
48
48
|
|
|
49
49
|
# Check resolved dependencies for 'user_repository'
|
|
50
|
-
dependencies:
|
|
50
|
+
dependencies:KnownDependency = dep_user_repository
|
|
51
51
|
self.assertEqual(dependencies.module_name, 'tests.services.inspection.dependencies.mocks.mock_user')
|
|
52
52
|
self.assertEqual(dependencies.class_name, 'FakeUser')
|
|
53
53
|
self.assertEqual(dependencies.full_class_path, 'tests.services.inspection.dependencies.mocks.mock_user.FakeUser')
|
|
@@ -60,9 +60,9 @@ class TestReflectDependencies(TestCase):
|
|
|
60
60
|
This test verifies:
|
|
61
61
|
- The returned object is an instance of `MethodDependency`.
|
|
62
62
|
- There are no unresolved dependencies.
|
|
63
|
-
- The 'user_permissions' dependency is correctly resolved as an instance of `
|
|
63
|
+
- The 'user_permissions' dependency is correctly resolved as an instance of `KnownDependency` with the expected
|
|
64
64
|
module name, class name, full class path, and type (`FakeUserWithPermissions`).
|
|
65
|
-
- The 'permissions' dependency is correctly resolved as an instance of `
|
|
65
|
+
- The 'permissions' dependency is correctly resolved as an instance of `KnownDependency` with the expected
|
|
66
66
|
module name, class name, full class path, and type (`list[str]`).
|
|
67
67
|
"""
|
|
68
68
|
|
|
@@ -75,9 +75,9 @@ class TestReflectDependencies(TestCase):
|
|
|
75
75
|
# Check unresolved dependencies
|
|
76
76
|
self.assertEqual(method_dependencies.unresolved, [])
|
|
77
77
|
|
|
78
|
-
# Check Instance of
|
|
79
|
-
dep_user_permissions:
|
|
80
|
-
self.assertIsInstance(dep_user_permissions,
|
|
78
|
+
# Check Instance of KnownDependency for 'user_permissions'
|
|
79
|
+
dep_user_permissions:KnownDependency = method_dependencies.resolved.get('user_permissions')
|
|
80
|
+
self.assertIsInstance(dep_user_permissions, KnownDependency)
|
|
81
81
|
|
|
82
82
|
# Check resolved dependencies for 'user_permissions'
|
|
83
83
|
self.assertEqual(dep_user_permissions.module_name, 'tests.services.inspection.dependencies.mocks.mock_users_permissions')
|
|
@@ -85,9 +85,9 @@ class TestReflectDependencies(TestCase):
|
|
|
85
85
|
self.assertEqual(dep_user_permissions.full_class_path, 'tests.services.inspection.dependencies.mocks.mock_users_permissions.FakeUserWithPermissions')
|
|
86
86
|
self.assertEqual(dep_user_permissions.type, FakeUserWithPermissions)
|
|
87
87
|
|
|
88
|
-
# Check Instance of
|
|
89
|
-
dep_permissions:
|
|
90
|
-
self.assertIsInstance(dep_permissions,
|
|
88
|
+
# Check Instance of KnownDependency for 'permissions'
|
|
89
|
+
dep_permissions:KnownDependency = method_dependencies.resolved.get('permissions')
|
|
90
|
+
self.assertIsInstance(dep_permissions, KnownDependency)
|
|
91
91
|
|
|
92
92
|
# Check resolved dependencies for 'permissions'
|
|
93
93
|
self.assertEqual(dep_permissions.module_name, 'builtins')
|
|
@@ -101,7 +101,7 @@ class TestReflectDependencies(TestCase):
|
|
|
101
101
|
This test verifies:
|
|
102
102
|
- The returned dependencies are an instance of `MethodDependency`.
|
|
103
103
|
- There are no unresolved dependencies.
|
|
104
|
-
- The 'x' and 'y' parameters are correctly resolved as instances of `
|
|
104
|
+
- The 'x' and 'y' parameters are correctly resolved as instances of `KnownDependency` with the expected
|
|
105
105
|
module name, class name, full class path, and type (`int`).
|
|
106
106
|
"""
|
|
107
107
|
|
|
@@ -119,10 +119,10 @@ class TestReflectDependencies(TestCase):
|
|
|
119
119
|
# Check unresolved dependencies
|
|
120
120
|
self.assertEqual(callable_dependencies.unresolved, [])
|
|
121
121
|
|
|
122
|
-
# Check Instance of
|
|
123
|
-
dep_x:
|
|
122
|
+
# Check Instance of KnownDependency for 'x'
|
|
123
|
+
dep_x:KnownDependency = callable_dependencies.resolved.get('x')
|
|
124
124
|
self.assertEqual(dep_x, 3)
|
|
125
125
|
|
|
126
|
-
# Check Instance of
|
|
127
|
-
dep_y:
|
|
126
|
+
# Check Instance of KnownDependency for 'y'
|
|
127
|
+
dep_y:KnownDependency = callable_dependencies.resolved.get('y')
|
|
128
128
|
self.assertEqual(dep_y, 4)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.services.introspection.abstract.reflection import ReflectionAbstract
|
|
2
2
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
|
3
3
|
from tests.services.inspection.reflection.mock.fake_reflect_instance import AbstractFakeClass
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestServiceReflectionAbstract(
|
|
6
|
+
class TestServiceReflectionAbstract(AsyncTestCase):
|
|
7
7
|
|
|
8
8
|
async def testGetClass(self):
|
|
9
9
|
"""
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.services.introspection.callables.reflection import ReflectionCallable
|
|
2
2
|
from orionis.services.introspection.dependencies.entities.callable_dependencies import CallableDependency
|
|
3
|
-
from orionis.
|
|
3
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
4
4
|
from orionis.services.introspection.exceptions import ReflectionTypeError
|
|
5
5
|
|
|
6
|
-
class TestReflectionCallable(
|
|
6
|
+
class TestReflectionCallable(AsyncTestCase):
|
|
7
7
|
|
|
8
8
|
async def testInitValidFunction(self):
|
|
9
9
|
"""
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.services.introspection.concretes.reflection import ReflectionConcrete
|
|
2
2
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
|
3
3
|
from tests.services.inspection.reflection.mock.fake_reflect_instance import FakeClass
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestServiceReflectionConcrete(
|
|
6
|
+
class TestServiceReflectionConcrete(AsyncTestCase):
|
|
7
7
|
|
|
8
8
|
async def testGetInstance(self):
|
|
9
9
|
"""
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
|
2
2
|
from tests.services.inspection.reflection.mock.fake_reflect_instance import FakeClass
|
|
3
3
|
from orionis.services.introspection.instances.reflection import ReflectionInstance
|
|
4
|
-
from orionis.
|
|
4
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
5
5
|
|
|
6
|
-
class TestServiceReflectionInstance(
|
|
6
|
+
class TestServiceReflectionInstance(AsyncTestCase):
|
|
7
7
|
|
|
8
8
|
async def testGetInstance(self):
|
|
9
9
|
"""
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
from orionis.
|
|
1
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
2
2
|
from orionis.services.introspection.modules.reflection import ReflectionModule
|
|
3
3
|
from orionis.services.introspection.exceptions import ReflectionTypeError, ReflectionValueError
|
|
4
4
|
|
|
5
|
-
class TestServiceReflectionModule(
|
|
5
|
+
class TestServiceReflectionModule(AsyncTestCase):
|
|
6
6
|
|
|
7
7
|
module_name = 'tests.services.inspection.reflection.mock.fake_reflect_instance'
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from orionis.services.introspection.reflection import Reflection
|
|
2
|
-
from orionis.
|
|
2
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
3
3
|
import sys
|
|
4
4
|
import inspect
|
|
5
5
|
import abc
|
|
6
6
|
|
|
7
|
-
class TestServiceReflectionAbstract(
|
|
7
|
+
class TestServiceReflectionAbstract(AsyncTestCase):
|
|
8
8
|
|
|
9
9
|
async def testIsAbstract(self):
|
|
10
10
|
"""
|
|
@@ -3,9 +3,9 @@ import tempfile
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from orionis.services.paths.exceptions import OrionisFileNotFoundException
|
|
5
5
|
from orionis.services.paths.resolver import Resolver
|
|
6
|
-
from orionis.
|
|
6
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
7
7
|
|
|
8
|
-
class TestServicesResolver(
|
|
8
|
+
class TestServicesResolver(AsyncTestCase):
|
|
9
9
|
|
|
10
10
|
async def testFileNotFound(self):
|
|
11
11
|
"""
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from orionis.services.system.imports import Imports
|
|
2
|
-
from orionis.
|
|
2
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
3
3
|
import sys
|
|
4
4
|
import types
|
|
5
5
|
|
|
6
|
-
class TestServicesSystemImports(
|
|
6
|
+
class TestServicesSystemImports(AsyncTestCase):
|
|
7
7
|
|
|
8
8
|
def testImportModule(self) -> None:
|
|
9
9
|
"""
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
from unittest.mock import patch
|
|
1
2
|
from orionis.services.system.workers import Workers
|
|
2
|
-
from orionis.
|
|
3
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
3
4
|
|
|
4
|
-
class TestServicesSystemWorkers(
|
|
5
|
+
class TestServicesSystemWorkers(AsyncTestCase):
|
|
5
6
|
"""
|
|
6
7
|
Unit tests for the Workers class.
|
|
7
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from orionis.support.formatter.serializer import Parser
|
|
2
|
-
from orionis.
|
|
2
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
3
3
|
from tests.support.parsers.mocks.mock_custom_error import CustomError
|
|
4
4
|
|
|
5
|
-
class TestServicesParserExceptions(
|
|
5
|
+
class TestServicesParserExceptions(AsyncTestCase):
|
|
6
6
|
|
|
7
7
|
async def testBasicExceptionStructure(self):
|
|
8
8
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from orionis.support.patterns.singleton import Singleton
|
|
2
|
-
from orionis.test.cases.
|
|
2
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
3
3
|
|
|
4
|
-
class TestPatternsSingleton(
|
|
4
|
+
class TestPatternsSingleton(AsyncTestCase):
|
|
5
5
|
"""
|
|
6
6
|
Test cases for the Singleton metaclass.
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from orionis.support.standard.exceptions import OrionisStdValueException
|
|
2
2
|
from orionis.support.standard.std import StdClass
|
|
3
|
-
from orionis.
|
|
3
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
4
4
|
|
|
5
|
-
class TestSupportStd(
|
|
5
|
+
class TestSupportStd(AsyncTestCase):
|
|
6
6
|
|
|
7
7
|
async def testInitializationAndAccess(self):
|
|
8
8
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from orionis.support.wrapper import DotDict
|
|
2
|
-
from orionis.
|
|
2
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
3
3
|
|
|
4
|
-
class TestSupportWrapperDocDict(
|
|
4
|
+
class TestSupportWrapperDocDict(AsyncTestCase):
|
|
5
5
|
"""
|
|
6
6
|
Test cases for the DotDict class which provides dictionary with dot notation access.
|
|
7
7
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
from orionis.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
TestStatus
|
|
5
|
-
)
|
|
1
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
2
|
+
from orionis.test.entities.result import TestResult
|
|
3
|
+
from orionis.test.enums import TestStatus
|
|
6
4
|
|
|
7
|
-
class TestTestingResult(
|
|
5
|
+
class TestTestingResult(AsyncTestCase):
|
|
8
6
|
|
|
9
7
|
async def testDefaultValues(self) -> None:
|
|
10
8
|
"""
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
StandardTestResult
|
|
1
|
+
from unittest import TestLoader
|
|
2
|
+
from unittest.mock import MagicMock, patch
|
|
3
|
+
from orionis.test.cases.asynchronous import AsyncTestCase
|
|
4
|
+
from orionis.test.core.unit_test import UnitTest
|
|
5
|
+
from orionis.test.enums import ExecutionMode
|
|
6
|
+
from unittest import (
|
|
7
|
+
TestSuite as StandardTestSuite,
|
|
8
|
+
TestResult as StandardTestResult
|
|
10
9
|
)
|
|
11
10
|
|
|
12
|
-
class TestTestingUnit(
|
|
11
|
+
class TestTestingUnit(AsyncTestCase):
|
|
13
12
|
|
|
14
13
|
async def testDefaultConfiguration(self) -> None:
|
|
15
14
|
"""
|
orionis/test/cases/test_async.py
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import unittest
|
|
2
|
-
from orionis.test.output.dumper import TestDumper
|
|
3
|
-
|
|
4
|
-
class AsyncTestCase(unittest.IsolatedAsyncioTestCase, TestDumper):
|
|
5
|
-
"""
|
|
6
|
-
Base test case for async unit tests.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
async def asyncSetUp(self):
|
|
10
|
-
"""
|
|
11
|
-
Asynchronous setup method for test cases.
|
|
12
|
-
|
|
13
|
-
This method is called before each test coroutine is run. It first calls the parent
|
|
14
|
-
class's asyncSetUp method to perform any necessary setup defined in the superclass,
|
|
15
|
-
then calls the onAsyncSetup coroutine for additional setup specific to this test case.
|
|
16
|
-
|
|
17
|
-
Override onAsyncSetup to implement custom asynchronous setup logic.
|
|
18
|
-
|
|
19
|
-
Returns:
|
|
20
|
-
Awaitable: Completes when setup is finished.
|
|
21
|
-
"""
|
|
22
|
-
await super().asyncSetUp()
|
|
23
|
-
await self.onAsyncSetup()
|
|
24
|
-
|
|
25
|
-
async def asyncTearDown(self):
|
|
26
|
-
"""
|
|
27
|
-
Asynchronous teardown method called after each test.
|
|
28
|
-
|
|
29
|
-
This method performs any necessary asynchronous cleanup by first calling
|
|
30
|
-
`onAsyncTeardown()` for custom teardown logic, then invoking the superclass's
|
|
31
|
-
`asyncTearDown()` to ensure proper teardown in the class hierarchy.
|
|
32
|
-
"""
|
|
33
|
-
await self.onAsyncTeardown()
|
|
34
|
-
await super().asyncTearDown()
|
|
35
|
-
|
|
36
|
-
async def onAsyncSetup(self):
|
|
37
|
-
"""
|
|
38
|
-
Asynchronous setup method to be executed before running tests.
|
|
39
|
-
|
|
40
|
-
This method can be overridden to perform any asynchronous initialization
|
|
41
|
-
required for the test case. By default, it does nothing.
|
|
42
|
-
|
|
43
|
-
Returns:
|
|
44
|
-
None
|
|
45
|
-
"""
|
|
46
|
-
pass
|
|
47
|
-
|
|
48
|
-
async def onAsyncTeardown(self):
|
|
49
|
-
"""
|
|
50
|
-
Asynchronous teardown method to be executed after each test case.
|
|
51
|
-
|
|
52
|
-
This method can be overridden to perform any necessary cleanup operations
|
|
53
|
-
that need to run asynchronously after the completion of a test case.
|
|
54
|
-
"""
|
|
55
|
-
pass
|