codecraftai-testbase 1.3.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.
- ccai/factories/py.typed +0 -0
- ccai/factories/testbasedefaulttypefactory.py +25 -0
- ccai/testbase/__init__.py +63 -0
- ccai/testbase/breakpoints.py +110 -0
- ccai/testbase/cli/__init__.py +13 -0
- ccai/testbase/cli/cmdtree/agents/__init__.py +28 -0
- ccai/testbase/cli/cmdtree/agents/config/__init__.py +24 -0
- ccai/testbase/cli/cmdtree/agents/config/extract.py +94 -0
- ccai/testbase/cli/cmdtree/agents/formatting.py +71 -0
- ccai/testbase/cli/cmdtree/agents/jsosparser.py +119 -0
- ccai/testbase/cli/cmdtree/agents/pathresolver.py +34 -0
- ccai/testbase/cli/cmdtree/agents/summary/__init__.py +26 -0
- ccai/testbase/cli/cmdtree/agents/summary/compare.py +128 -0
- ccai/testbase/cli/cmdtree/agents/summary/extract.py +91 -0
- ccai/testbase/cli/cmdtree/agents/testresult/__init__.py +28 -0
- ccai/testbase/cli/cmdtree/agents/testresult/extract.py +77 -0
- ccai/testbase/cli/cmdtree/agents/testresult/failures.py +73 -0
- ccai/testbase/cli/cmdtree/agents/testresult/list.py +63 -0
- ccai/testbase/cli/cmdtree/services/__init__.py +27 -0
- ccai/testbase/cli/cmdtree/services/results.py +66 -0
- ccai/testbase/cli/cmdtree/testing/__init__.py +30 -0
- ccai/testbase/cli/cmdtree/testing/jobs.py +175 -0
- ccai/testbase/cli/cmdtree/testing/query.py +131 -0
- ccai/testbase/cli/cmdtree/testing/run.py +263 -0
- ccai/testbase/cli/cmdtree/utilities/__init__.py +28 -0
- ccai/testbase/cli/cmdtree/utilities/timestamp.py +33 -0
- ccai/testbase/cli/options.py +370 -0
- ccai/testbase/cli/testbase_command.py +64 -0
- ccai/testbase/cli/utilities.py +31 -0
- ccai/testbase/configuration.py +324 -0
- ccai/testbase/constraints.py +998 -0
- ccai/testbase/coupling/__init__.py +569 -0
- ccai/testbase/coupling/basecoupling.py +69 -0
- ccai/testbase/coupling/configurationcoupling.py +138 -0
- ccai/testbase/coupling/integrationcoupling.py +842 -0
- ccai/testbase/coupling/validatorcoupling.py +127 -0
- ccai/testbase/debuggingext.py +281 -0
- ccai/testbase/debuglogging.py +407 -0
- ccai/testbase/debugports.py +469 -0
- ccai/testbase/declaration/__init__.py +13 -0
- ccai/testbase/declaration/attachments.py +222 -0
- ccai/testbase/declaration/originations.py +217 -0
- ccai/testbase/declaration/parameterization.py +160 -0
- ccai/testbase/declaration/registrations.py +476 -0
- ccai/testbase/diagnostic_level.py +197 -0
- ccai/testbase/diagnostic_streaming.py +1534 -0
- ccai/testbase/diagnostics.py +1685 -0
- ccai/testbase/entrypoints.py +485 -0
- ccai/testbase/environment.py +162 -0
- ccai/testbase/errors/testruntimeouterror.py +50 -0
- ccai/testbase/expressions.py +355 -0
- ccai/testbase/factories.py +277 -0
- ccai/testbase/factoryprotocols.py +35 -0
- ccai/testbase/features.py +913 -0
- ccai/testbase/initialize.py +210 -0
- ccai/testbase/injection/__init__.py +25 -0
- ccai/testbase/injection/injectiongroup.py +493 -0
- ccai/testbase/injection/injectionmoment.py +155 -0
- ccai/testbase/injection/injectionregistry.py +823 -0
- ccai/testbase/injection/injectionscope.py +2589 -0
- ccai/testbase/injection/introspection.py +514 -0
- ccai/testbase/markers.py +665 -0
- ccai/testbase/mocking.py +4856 -0
- ccai/testbase/origins/__init__.py +13 -0
- ccai/testbase/origins/resourceorigin.py +110 -0
- ccai/testbase/origins/validatororigin.py +111 -0
- ccai/testbase/output/__init__.py +17 -0
- ccai/testbase/output/outputcontext.py +201 -0
- ccai/testbase/output/runmetadata.py +184 -0
- ccai/testbase/properties/__init__.py +40 -0
- ccai/testbase/properties/assumptions.py +56 -0
- ccai/testbase/properties/decorators.py +173 -0
- ccai/testbase/properties/propertyrunner.py +449 -0
- ccai/testbase/properties/strategies.py +1592 -0
- ccai/testbase/properties/unittestsupport.py +87 -0
- ccai/testbase/py.typed +0 -0
- ccai/testbase/queries.py +95 -0
- ccai/testbase/resourcelifespan.py +24 -0
- ccai/testbase/results/__init__.py +35 -0
- ccai/testbase/results/exceptions.py +60 -0
- ccai/testbase/results/filtering/__init__.py +26 -0
- ccai/testbase/results/filtering/resultfilter.py +570 -0
- ccai/testbase/results/model/__init__.py +32 -0
- ccai/testbase/results/model/buildinfo.py +54 -0
- ccai/testbase/results/model/checkresult.py +183 -0
- ccai/testbase/results/model/forwardinginfo.py +30 -0
- ccai/testbase/results/model/jobcontainer.py +32 -0
- ccai/testbase/results/model/jobinfo.py +91 -0
- ccai/testbase/results/model/nestedprogressinfo.py +211 -0
- ccai/testbase/results/model/pipelineinfo.py +51 -0
- ccai/testbase/results/model/progressaggregator.py +551 -0
- ccai/testbase/results/model/progresscode.py +29 -0
- ccai/testbase/results/model/progressdelivery.py +51 -0
- ccai/testbase/results/model/progressinfo.py +84 -0
- ccai/testbase/results/model/progresstype.py +24 -0
- ccai/testbase/results/model/renderinfo.py +30 -0
- ccai/testbase/results/model/resultcode.py +28 -0
- ccai/testbase/results/model/resultcontainer.py +95 -0
- ccai/testbase/results/model/resultnode.py +258 -0
- ccai/testbase/results/model/resulttype.py +34 -0
- ccai/testbase/results/model/streaminginfo.py +111 -0
- ccai/testbase/results/model/taskinggroup.py +85 -0
- ccai/testbase/results/model/taskingresult.py +297 -0
- ccai/testbase/results/model/testcontainer.py +35 -0
- ccai/testbase/results/model/testresult.py +170 -0
- ccai/testbase/results/recorders/__init__.py +31 -0
- ccai/testbase/results/recorders/csvresultrecorder.py +414 -0
- ccai/testbase/results/recorders/jsonresultrecorder.py +467 -0
- ccai/testbase/results/recorders/resultrecorder.py +1472 -0
- ccai/testbase/results/recorders/stdoutresultrecorder.py +70 -0
- ccai/testbase/results/recorders/xmlresultrecorder.py +305 -0
- ccai/testbase/results/utilities.py +141 -0
- ccai/testbase/sequencing/__init__.py +13 -0
- ccai/testbase/sequencing/sequencermodulescope.py +96 -0
- ccai/testbase/sequencing/sequencerscopebase.py +91 -0
- ccai/testbase/sequencing/sequencersessionscope.py +84 -0
- ccai/testbase/sequencing/sequencertestscope.py +249 -0
- ccai/testbase/sequencing/sequencertestsetupscope.py +86 -0
- ccai/testbase/sequencing/testactivity.py +111 -0
- ccai/testbase/sequencing/testsequencer.py +3072 -0
- ccai/testbase/server/__init__.py +13 -0
- ccai/testbase/server/resultserver.py +599 -0
- ccai/testbase/sources/__init__.py +13 -0
- ccai/testbase/sources/configurationsource.py +32 -0
- ccai/testbase/sources/integrationsource.py +29 -0
- ccai/testbase/sources/resourcesource.py +27 -0
- ccai/testbase/sources/sourcebase.py +71 -0
- ccai/testbase/sources/unknownsource.py +30 -0
- ccai/testbase/sources/validatorsource.py +28 -0
- ccai/testbase/tandem/__init__.py +13 -0
- ccai/testbase/tandem/validators.py +286 -0
- ccai/testbase/testcollector.py +230 -0
- ccai/testbase/testgroup.py +54 -0
- ccai/testbase/testjob.py +600 -0
- ccai/testbase/testref.py +64 -0
- ccai/testbase/utilities.py +472 -0
- ccai/testbase/verification.py +768 -0
- codecraftai_testbase-1.3.0.dist-info/METADATA +99 -0
- codecraftai_testbase-1.3.0.dist-info/RECORD +142 -0
- codecraftai_testbase-1.3.0.dist-info/WHEEL +4 -0
- codecraftai_testbase-1.3.0.dist-info/entry_points.txt +3 -0
- codecraftai_testbase-1.3.0.dist-info/licenses/LICENSE.md +204 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"""
|
|
2
|
+
.. module:: ccai.testbase.coupling.configurationcoupling
|
|
3
|
+
:platform: Darwin, Linux, Unix, Windows
|
|
4
|
+
:synopsis: Module containing the :class:`ConfigurationCoupling` class for declaring
|
|
5
|
+
configuration specifications that must be satisfied for a test environment.
|
|
6
|
+
|
|
7
|
+
.. moduleauthor:: Myron Walker <myron.walker@gmail.com>
|
|
8
|
+
|
|
9
|
+
The ConfigurationCoupling module provides a mechanism for declaring configuration specifications
|
|
10
|
+
that must be satisfied for a test environment to function. Configuration couplings are used to
|
|
11
|
+
load and validate environment configurations, set up connection pools, and ensure all required
|
|
12
|
+
configuration parameters are present before test execution begins.
|
|
13
|
+
|
|
14
|
+
Example usage::
|
|
15
|
+
|
|
16
|
+
from ccai.testbase.coupling.configurationcoupling import ConfigurationCoupling
|
|
17
|
+
|
|
18
|
+
class DatabaseConfiguration(ConfigurationCoupling):
|
|
19
|
+
'''
|
|
20
|
+
Configuration coupling for database connectivity.
|
|
21
|
+
'''
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def attach_to_environment(cls, constraints=None):
|
|
25
|
+
# Load database configuration
|
|
26
|
+
# Validate connection parameters
|
|
27
|
+
# Set up connection pool
|
|
28
|
+
return
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
__author__ = "Myron Walker"
|
|
33
|
+
__copyright__ = "Copyright 2025, Code Craft AI LLC"
|
|
34
|
+
__credits__ = []
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
from typing import Dict, Optional
|
|
38
|
+
|
|
39
|
+
from ccai.testbase.coupling.basecoupling import BaseCoupling
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class ConfigurationCoupling(BaseCoupling):
|
|
43
|
+
"""
|
|
44
|
+
The :class:`ConfigurationCoupling` class is the base class for configuration declaration
|
|
45
|
+
objects. Derived classes are used to declare a specification of a collection of resources
|
|
46
|
+
that must be delivered in order for an automation environment to exist.
|
|
47
|
+
|
|
48
|
+
Configuration couplings provide a way to:
|
|
49
|
+
|
|
50
|
+
* Load and validate environment configurations
|
|
51
|
+
* Set up connection pools and shared resources
|
|
52
|
+
* Ensure required configuration parameters are present
|
|
53
|
+
* Apply constraint-based configuration modifications
|
|
54
|
+
|
|
55
|
+
Unlike :class:`IntegrationCoupling`, configuration couplings have a simpler lifecycle
|
|
56
|
+
with only the :meth:`attach_to_environment` method for customization. The base class
|
|
57
|
+
provides a default implementation that does nothing, allowing derived classes to
|
|
58
|
+
override only when needed.
|
|
59
|
+
|
|
60
|
+
Example usage::
|
|
61
|
+
|
|
62
|
+
from ccai.testbase.coupling.configurationcoupling import ConfigurationCoupling
|
|
63
|
+
|
|
64
|
+
class TestEnvironmentConfig(ConfigurationCoupling):
|
|
65
|
+
'''
|
|
66
|
+
Configuration for the test environment.
|
|
67
|
+
'''
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def attach_to_environment(cls, constraints=None):
|
|
71
|
+
# Load configuration from file or environment
|
|
72
|
+
config = load_config()
|
|
73
|
+
|
|
74
|
+
# Apply constraints if provided
|
|
75
|
+
if constraints is not None:
|
|
76
|
+
config.update(constraints)
|
|
77
|
+
|
|
78
|
+
# Validate configuration
|
|
79
|
+
validate_config(config)
|
|
80
|
+
return
|
|
81
|
+
|
|
82
|
+
.. seealso::
|
|
83
|
+
:class:`BaseCoupling` for the base coupling type
|
|
84
|
+
:class:`IntegrationCoupling` for external resource integration
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
def __init__(self):
|
|
88
|
+
"""
|
|
89
|
+
Initializes a new :class:`ConfigurationCoupling` instance.
|
|
90
|
+
|
|
91
|
+
The default constructor requires no arguments and performs no initialization
|
|
92
|
+
beyond what is inherited from :class:`BaseCoupling`.
|
|
93
|
+
|
|
94
|
+
Example usage::
|
|
95
|
+
|
|
96
|
+
config = ConfigurationCoupling()
|
|
97
|
+
"""
|
|
98
|
+
return
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def attach_to_environment(cls, constraints: Optional[Dict] = None):
|
|
102
|
+
"""
|
|
103
|
+
Processes configuration information and attaches the coupling to the test environment.
|
|
104
|
+
|
|
105
|
+
This method is called during the test framework initialization phase to allow the
|
|
106
|
+
configuration coupling to load, validate, and apply configuration settings. The
|
|
107
|
+
base implementation does nothing and returns immediately, allowing derived classes
|
|
108
|
+
to override this behavior as needed.
|
|
109
|
+
|
|
110
|
+
:param constraints: An optional dictionary containing constraint parameters that
|
|
111
|
+
can be used to modify or parameterize the configuration behavior. The structure
|
|
112
|
+
and interpretation of constraints is defined by the derived class implementation.
|
|
113
|
+
|
|
114
|
+
:returns: None. This method does not return a value.
|
|
115
|
+
|
|
116
|
+
:raises ccai.errors.exceptions.AKitMissingConfigError: When required configuration
|
|
117
|
+
is missing (raised by derived class implementations).
|
|
118
|
+
:raises ccai.errors.exceptions.ConfigurationError: When configuration validation
|
|
119
|
+
fails (raised by derived class implementations).
|
|
120
|
+
|
|
121
|
+
Example usage::
|
|
122
|
+
|
|
123
|
+
# Without constraints
|
|
124
|
+
MyConfiguration.attach_to_environment()
|
|
125
|
+
|
|
126
|
+
# With constraints
|
|
127
|
+
constraints = {
|
|
128
|
+
'database_host': 'localhost',
|
|
129
|
+
'database_port': 5432
|
|
130
|
+
}
|
|
131
|
+
MyConfiguration.attach_to_environment(constraints=constraints)
|
|
132
|
+
|
|
133
|
+
.. note::
|
|
134
|
+
The base class implementation does nothing. Derived classes should override
|
|
135
|
+
this method to implement their specific configuration loading and validation
|
|
136
|
+
logic.
|
|
137
|
+
"""
|
|
138
|
+
return
|