baldertest 0.1.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.
- _balder/__init__.py +12 -0
- _balder/_version.py +34 -0
- _balder/balder_plugin.py +73 -0
- _balder/balder_session.py +341 -0
- _balder/balder_settings.py +15 -0
- _balder/cnnrelations/__init__.py +7 -0
- _balder/cnnrelations/and_connection_relation.py +176 -0
- _balder/cnnrelations/base_connection_relation.py +270 -0
- _balder/cnnrelations/or_connection_relation.py +65 -0
- _balder/collector.py +874 -0
- _balder/connection.py +863 -0
- _balder/connection_metadata.py +255 -0
- _balder/console/__init__.py +0 -0
- _balder/console/balder.py +58 -0
- _balder/controllers/__init__.py +12 -0
- _balder/controllers/base_device_controller.py +72 -0
- _balder/controllers/controller.py +29 -0
- _balder/controllers/device_controller.py +446 -0
- _balder/controllers/feature_controller.py +715 -0
- _balder/controllers/normal_scenario_setup_controller.py +402 -0
- _balder/controllers/scenario_controller.py +524 -0
- _balder/controllers/setup_controller.py +134 -0
- _balder/controllers/vdevice_controller.py +95 -0
- _balder/decorator_connect.py +104 -0
- _balder/decorator_covered_by.py +74 -0
- _balder/decorator_fixture.py +29 -0
- _balder/decorator_for_vdevice.py +118 -0
- _balder/decorator_gateway.py +34 -0
- _balder/decorator_insert_into_tree.py +52 -0
- _balder/decorator_parametrize.py +31 -0
- _balder/decorator_parametrize_by_feature.py +36 -0
- _balder/device.py +18 -0
- _balder/exceptions.py +182 -0
- _balder/executor/__init__.py +0 -0
- _balder/executor/basic_executable_executor.py +133 -0
- _balder/executor/basic_executor.py +205 -0
- _balder/executor/executor_tree.py +217 -0
- _balder/executor/parametrized_testcase_executor.py +52 -0
- _balder/executor/scenario_executor.py +169 -0
- _balder/executor/setup_executor.py +163 -0
- _balder/executor/testcase_executor.py +203 -0
- _balder/executor/unresolved_parametrized_testcase_executor.py +184 -0
- _balder/executor/variation_executor.py +882 -0
- _balder/exit_code.py +19 -0
- _balder/feature.py +74 -0
- _balder/feature_replacement_mapping.py +107 -0
- _balder/feature_vdevice_mapping.py +88 -0
- _balder/fixture_definition_scope.py +19 -0
- _balder/fixture_execution_level.py +22 -0
- _balder/fixture_manager.py +483 -0
- _balder/fixture_metadata.py +26 -0
- _balder/node_gateway.py +103 -0
- _balder/objects/__init__.py +0 -0
- _balder/objects/connections/__init__.py +0 -0
- _balder/objects/connections/osi_1_physical.py +116 -0
- _balder/objects/connections/osi_2_datalink.py +35 -0
- _balder/objects/connections/osi_3_network.py +47 -0
- _balder/objects/connections/osi_4_transport.py +40 -0
- _balder/objects/connections/osi_5_session.py +13 -0
- _balder/objects/connections/osi_6_presentation.py +13 -0
- _balder/objects/connections/osi_7_application.py +83 -0
- _balder/objects/devices/__init__.py +0 -0
- _balder/objects/devices/this_device.py +12 -0
- _balder/parametrization.py +75 -0
- _balder/plugin_manager.py +138 -0
- _balder/previous_executor_mark.py +23 -0
- _balder/routing_path.py +335 -0
- _balder/scenario.py +20 -0
- _balder/setup.py +18 -0
- _balder/solver.py +246 -0
- _balder/testresult.py +163 -0
- _balder/unmapped_vdevice.py +13 -0
- _balder/utils/__init__.py +0 -0
- _balder/utils/functions.py +103 -0
- _balder/utils/inner_device_managing_metaclass.py +14 -0
- _balder/utils/mixin_can_be_covered_by_executor.py +24 -0
- _balder/utils/typings.py +4 -0
- _balder/vdevice.py +9 -0
- balder/__init__.py +56 -0
- balder/connections.py +43 -0
- balder/devices.py +9 -0
- balder/exceptions.py +44 -0
- balder/parametrization.py +8 -0
- baldertest-0.1.0.dist-info/METADATA +356 -0
- baldertest-0.1.0.dist-info/RECORD +89 -0
- baldertest-0.1.0.dist-info/WHEEL +5 -0
- baldertest-0.1.0.dist-info/entry_points.txt +2 -0
- baldertest-0.1.0.dist-info/licenses/LICENSE +21 -0
- baldertest-0.1.0.dist-info/top_level.txt +2 -0
_balder/testresult.py
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass, fields
|
|
4
|
+
from typing import TYPE_CHECKING, List, Union
|
|
5
|
+
|
|
6
|
+
from enum import Enum
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from _balder.executor.basic_executor import BasicExecutor
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ResultState(Enum):
|
|
13
|
+
"""
|
|
14
|
+
enumeration that describes the possible results of a testcase-/fixture-executor
|
|
15
|
+
"""
|
|
16
|
+
# this state will be assigned if the executor doesn't run yet
|
|
17
|
+
NOT_RUN = 'not_run'
|
|
18
|
+
# this state will be assigned if the test fails (only assignable to :class:`TestcaseExecutor`)
|
|
19
|
+
FAILURE = 'failure'
|
|
20
|
+
# this state will be assigned if the executor can not be executed because the fixture fails (only possible in
|
|
21
|
+
# construction part of fixtures, if the error occurs in teardown the next higher executer get this state) - will be
|
|
22
|
+
# assigned to the executor which has the fixture that fails
|
|
23
|
+
ERROR = 'error'
|
|
24
|
+
# this state will be assigned if the executor was executed successfully (session fixture and teardown fixture; for
|
|
25
|
+
# :class:`TestcaseExecutor` also the testcase itself)
|
|
26
|
+
SUCCESS = 'success'
|
|
27
|
+
# this state will be assigned if the executor was skipped
|
|
28
|
+
SKIP = 'skip'
|
|
29
|
+
# this state will be assigned if the executor is covered by another executor and wasn't executed (only assignable
|
|
30
|
+
# to :class:`ScenarioExecutor` and :class:`TestcaseExecutor`)
|
|
31
|
+
COVERED_BY = 'covered_by'
|
|
32
|
+
|
|
33
|
+
@staticmethod
|
|
34
|
+
def priority_order() -> List[ResultState]:
|
|
35
|
+
"""
|
|
36
|
+
returns an order of states that returns the highest priority as first item and the lowest as last one
|
|
37
|
+
"""
|
|
38
|
+
return [ResultState.ERROR, ResultState.FAILURE, ResultState.SUCCESS, ResultState.COVERED_BY, ResultState.SKIP,
|
|
39
|
+
ResultState.NOT_RUN]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class _Result:
|
|
43
|
+
|
|
44
|
+
def __init__(self, executor: BasicExecutor):
|
|
45
|
+
self._result = ResultState.NOT_RUN
|
|
46
|
+
|
|
47
|
+
self._related_executor = executor
|
|
48
|
+
#: contains the exception that was thrown and returned into this result
|
|
49
|
+
self.exception = None
|
|
50
|
+
|
|
51
|
+
self.char_mapping = {
|
|
52
|
+
ResultState.NOT_RUN: " ",
|
|
53
|
+
ResultState.FAILURE: "X",
|
|
54
|
+
ResultState.ERROR: "E",
|
|
55
|
+
ResultState.SUCCESS: ".",
|
|
56
|
+
ResultState.SKIP: "S",
|
|
57
|
+
ResultState.COVERED_BY: "C"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
def __str__(self):
|
|
61
|
+
return self.result.name
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def result(self) -> ResultState:
|
|
65
|
+
"""returns the result"""
|
|
66
|
+
return self._result
|
|
67
|
+
|
|
68
|
+
def get_result_as_char(self):
|
|
69
|
+
"""
|
|
70
|
+
returns a single char that represents the result state
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
return self.char_mapping[self.result]
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class _SettableResult(_Result):
|
|
77
|
+
ALLOWED_STATES = [ResultState.NOT_RUN, ResultState.FAILURE, ResultState.ERROR, ResultState.SUCCESS,
|
|
78
|
+
ResultState.SKIP, ResultState.COVERED_BY]
|
|
79
|
+
|
|
80
|
+
def set_result(self, result: ResultState, exception: Union[Exception, None] = None) -> None:
|
|
81
|
+
"""this method allows to set the result - if the value is SKIP or COVERED_BY this method automatically sets this
|
|
82
|
+
values also for all components of the branch in related executor"""
|
|
83
|
+
|
|
84
|
+
if result not in self.ALLOWED_STATES:
|
|
85
|
+
raise ValueError(
|
|
86
|
+
f"it is not allowed to set the given result `{result.name}` in a ´{self.__class__.__name__}´")
|
|
87
|
+
self._result = result
|
|
88
|
+
self.exception = exception
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class BranchBodyResult(_Result):
|
|
92
|
+
"""
|
|
93
|
+
This result is used in every branch body. So it isn't set directly, it is always determined depending on the
|
|
94
|
+
:class:`FixturePartResult` and :class:`TestcaseResult` of the executors children.
|
|
95
|
+
"""
|
|
96
|
+
|
|
97
|
+
def __init__(self, executor: BasicExecutor):
|
|
98
|
+
from _balder.executor.testcase_executor import TestcaseExecutor # pylint: disable=import-outside-toplevel
|
|
99
|
+
|
|
100
|
+
if isinstance(executor, TestcaseExecutor):
|
|
101
|
+
raise TypeError("testcase executors are not allowed to use in `BranchBodyResult`")
|
|
102
|
+
super().__init__(executor=executor)
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def result(self):
|
|
106
|
+
"""returns the determined result for the inner branch of the related executor"""
|
|
107
|
+
relative_result = ResultState.NOT_RUN
|
|
108
|
+
priority_order = ResultState.priority_order()
|
|
109
|
+
if self._related_executor.all_child_executors:
|
|
110
|
+
for cur_child in self._related_executor.all_child_executors:
|
|
111
|
+
if priority_order.index(cur_child.executor_result) < priority_order.index(relative_result):
|
|
112
|
+
relative_result = cur_child.executor_result
|
|
113
|
+
self._result = relative_result
|
|
114
|
+
return self._result
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class FixturePartResult(_SettableResult):
|
|
118
|
+
"""
|
|
119
|
+
This result is used for fixture construct or teardown code. It describes if there was an error in the construct
|
|
120
|
+
or teardown part of the fixture code for an executor.
|
|
121
|
+
"""
|
|
122
|
+
#: contains the possible values that can be set for this Result type
|
|
123
|
+
ALLOWED_STATES = [ResultState.NOT_RUN, ResultState.ERROR, ResultState.SUCCESS]
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class TestcaseResult(_SettableResult):
|
|
127
|
+
"""
|
|
128
|
+
This result is used for real executed testcase methods. These elements can only be assigned to real testcase methods
|
|
129
|
+
which are only available in :class:`TestcaseExecutor`.
|
|
130
|
+
"""
|
|
131
|
+
#: contains the possible values that can be set for this Result type
|
|
132
|
+
ALLOWED_STATES = [ResultState.NOT_RUN, ResultState.FAILURE, ResultState.SUCCESS, ResultState.SKIP,
|
|
133
|
+
ResultState.COVERED_BY]
|
|
134
|
+
|
|
135
|
+
@dataclass
|
|
136
|
+
class ResultSummary:
|
|
137
|
+
"""
|
|
138
|
+
object that holds the test results for multiple tests like on branch or global level
|
|
139
|
+
"""
|
|
140
|
+
# this state will be assigned if the executor doesn't run yet
|
|
141
|
+
not_run: int = 0
|
|
142
|
+
# this state will be assigned if the test fails (only assignable to :class:`TestcaseExecutor`)
|
|
143
|
+
failure: int = 0
|
|
144
|
+
# this state will be assigned if the executor can not be executed because the fixture fails (only possible in
|
|
145
|
+
# construction part of fixtures, if the error occurs in teardown the next higher executer get this state) - will be
|
|
146
|
+
# assigned to the executor which has the fixture that fails
|
|
147
|
+
error: int = 0
|
|
148
|
+
# this state will be assigned if the executor was executed successfully (session fixture and teardown fixture; for
|
|
149
|
+
# :class:`TestcaseExecutor` also the testcase itself)
|
|
150
|
+
success: int = 0
|
|
151
|
+
# this state will be assigned if the executor was skipped
|
|
152
|
+
skip: int = 0
|
|
153
|
+
# this state will be assigned if the executor is covered by another executor and wasn't executed (only assignable
|
|
154
|
+
# to :class:`ScenarioExecutor` and :class:`TestcaseExecutor`)
|
|
155
|
+
covered_by: int = 0
|
|
156
|
+
|
|
157
|
+
def __add__(self, other) -> ResultSummary:
|
|
158
|
+
new_summary = ResultSummary()
|
|
159
|
+
for cur_field in fields(self.__class__):
|
|
160
|
+
self_val = getattr(self, cur_field.name)
|
|
161
|
+
other_val = getattr(other, cur_field.name)
|
|
162
|
+
setattr(new_summary, cur_field.name, self_val + other_val)
|
|
163
|
+
return new_summary
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from _balder.vdevice import VDevice
|
|
2
|
+
from _balder.exceptions import AccessToUnmappedVDeviceException
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class UnmappedVDevice(VDevice):
|
|
6
|
+
"""
|
|
7
|
+
This special vdevice class will be assigned to all existing VDevice's that are not mapped during the execution of
|
|
8
|
+
a variation.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
def __getattr__(self, item):
|
|
12
|
+
raise AccessToUnmappedVDeviceException('it is not allowed to access the attributes of an unmapped VDevice - '
|
|
13
|
+
'did you forget to map it?')
|
|
File without changes
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import List, Type, Union, TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
import inspect
|
|
5
|
+
from _balder.scenario import Scenario
|
|
6
|
+
from _balder.exceptions import InheritanceError
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from _balder.connection import Connection
|
|
10
|
+
from _balder.cnnrelations.base_connection_relation import BaseConnectionRelationT
|
|
11
|
+
from _balder.utils.typings import MethodLiteralType
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_scenario_inheritance_list_of(scenario: Type[Scenario]) -> List[Type[Scenario]]:
|
|
15
|
+
"""
|
|
16
|
+
This method returns a list, beginning with the given `scenario`, of all parent classes that are from type
|
|
17
|
+
:class:´Scenario`. The last element of the list is always the original :class:`Scenario` class.
|
|
18
|
+
|
|
19
|
+
:param scenario: the scenario the method should look for in the inheritance list
|
|
20
|
+
|
|
21
|
+
:returns: a list with all classes that are from type scenario
|
|
22
|
+
"""
|
|
23
|
+
if scenario == Scenario:
|
|
24
|
+
return [Scenario]
|
|
25
|
+
base_class_of_interest = None
|
|
26
|
+
for cur_parent in scenario.__bases__:
|
|
27
|
+
if issubclass(cur_parent, Scenario):
|
|
28
|
+
if base_class_of_interest is not None:
|
|
29
|
+
raise InheritanceError("it is not allowed to have multiple parent class that inherit from the "
|
|
30
|
+
"class `Scenario`")
|
|
31
|
+
base_class_of_interest = cur_parent
|
|
32
|
+
|
|
33
|
+
return [scenario] + get_scenario_inheritance_list_of(base_class_of_interest)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def get_class_that_defines_method(meth):
|
|
37
|
+
"""credits to https://stackoverflow.com/a/25959545"""
|
|
38
|
+
if inspect.ismethod(meth):
|
|
39
|
+
for cls in inspect.getmro(meth.__self__.__class__):
|
|
40
|
+
if meth.__name__ in cls.__dict__:
|
|
41
|
+
return cls
|
|
42
|
+
meth = meth.__func__ # fallback to __qualname__ parsing
|
|
43
|
+
if inspect.isfunction(meth):
|
|
44
|
+
cls = getattr(inspect.getmodule(meth), meth.__qualname__.split('.<locals>', 1)[0].rsplit('.', 1)[0], None)
|
|
45
|
+
if isinstance(cls, type):
|
|
46
|
+
return cls
|
|
47
|
+
return None # not required since None would have been implicitly returned anyway
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def cnn_type_check_and_convert(elem: Union[Connection, Type[Connection], BaseConnectionRelationT]) \
|
|
51
|
+
-> Union[Connection, BaseConnectionRelationT]:
|
|
52
|
+
"""
|
|
53
|
+
converts possible type object to instance and checks if the element is a connection type
|
|
54
|
+
|
|
55
|
+
:param elem: the connection object to be converted/checked
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
from ..connection import Connection # pylint: disable=import-outside-toplevel
|
|
59
|
+
from ..cnnrelations.and_connection_relation import AndConnectionRelation # pylint: disable=import-outside-toplevel
|
|
60
|
+
from ..cnnrelations.or_connection_relation import OrConnectionRelation # pylint: disable=import-outside-toplevel
|
|
61
|
+
|
|
62
|
+
if isinstance(elem, type):
|
|
63
|
+
if issubclass(elem, Connection):
|
|
64
|
+
return elem()
|
|
65
|
+
elif isinstance(elem, (Connection, AndConnectionRelation, OrConnectionRelation)):
|
|
66
|
+
# okay
|
|
67
|
+
return elem
|
|
68
|
+
raise TypeError(f'object needs to be a `Connection`, a connection relation or a `Type[Connection]` - no '
|
|
69
|
+
f'`{elem}`')
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def get_method_type(func_class, func) -> MethodLiteralType:
|
|
73
|
+
"""
|
|
74
|
+
This helper function returns the type of the method (`staticmethod`, `classmethod` or `instancemethod`). It never
|
|
75
|
+
returns `function` because this type does not have a class.
|
|
76
|
+
"""
|
|
77
|
+
expected_class_qualname = func.__qualname__.rpartition('.')[0]
|
|
78
|
+
|
|
79
|
+
def get_for(the_class):
|
|
80
|
+
if func.__name__ in the_class.__dict__.keys() and the_class.__qualname__ == expected_class_qualname:
|
|
81
|
+
fn_type = the_class.__dict__.get(func.__name__)
|
|
82
|
+
|
|
83
|
+
if isinstance(fn_type, classmethod):
|
|
84
|
+
return 'classmethod'
|
|
85
|
+
|
|
86
|
+
if isinstance(fn_type, staticmethod):
|
|
87
|
+
return 'staticmethod'
|
|
88
|
+
|
|
89
|
+
if fn_type is not None and fn_type.__class__.__name__ == 'function':
|
|
90
|
+
return 'instancemethod'
|
|
91
|
+
raise TypeError(f'unknown element type `{func}`')
|
|
92
|
+
|
|
93
|
+
for cur_base in the_class.__bases__:
|
|
94
|
+
result = get_for(cur_base)
|
|
95
|
+
if result:
|
|
96
|
+
return result
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
meth_type = get_for(func_class)
|
|
100
|
+
if meth_type is None:
|
|
101
|
+
raise KeyError(f'the provided function `{func.__qualname__}` does not match with the provided class '
|
|
102
|
+
f'`{func_class.__qualname__}`')
|
|
103
|
+
return meth_type
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import inspect
|
|
3
|
+
from _balder.device import Device
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class InnerDeviceManagingMetaclass(type):
|
|
7
|
+
"""metaclass for all classes that holds :class:`Device` objects - sets the reference to the outer class for them"""
|
|
8
|
+
def __new__(mcs, name, parents, dct):
|
|
9
|
+
cls = super(InnerDeviceManagingMetaclass, mcs).__new__(mcs, name, parents, dct)
|
|
10
|
+
for inner_item in dct.values():
|
|
11
|
+
if inspect.isclass(inner_item) and issubclass(inner_item, Device):
|
|
12
|
+
inner_item._outer_balder_class = cls
|
|
13
|
+
|
|
14
|
+
return cls
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
from _balder.scenario import Scenario
|
|
7
|
+
from _balder.executor.scenario_executor import ScenarioExecutor
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MixinCanBeCoveredByExecutor(ABC):
|
|
11
|
+
"""mixin class for executor that can hold covered-by items"""
|
|
12
|
+
|
|
13
|
+
@property
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def scenario_executor(self) -> ScenarioExecutor:
|
|
16
|
+
"""
|
|
17
|
+
returns the current active scenario executor
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
@abstractmethod
|
|
21
|
+
def get_covered_by_element(self) -> list[Scenario | callable]:
|
|
22
|
+
"""
|
|
23
|
+
This method returns a list of elements where the elements of the executor are covered from.
|
|
24
|
+
"""
|
_balder/utils/typings.py
ADDED
_balder/vdevice.py
ADDED
balder/__init__.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from _balder import __version__, __version_tuple__
|
|
2
|
+
from _balder.setup import Setup
|
|
3
|
+
from _balder.device import Device
|
|
4
|
+
from _balder.vdevice import VDevice
|
|
5
|
+
from _balder.feature import Feature
|
|
6
|
+
from _balder.scenario import Scenario
|
|
7
|
+
from _balder.connection import Connection
|
|
8
|
+
from _balder.balder_plugin import BalderPlugin
|
|
9
|
+
from _balder.balder_settings import BalderSettings
|
|
10
|
+
from _balder.unmapped_vdevice import UnmappedVDevice
|
|
11
|
+
from _balder.decorator_fixture import fixture
|
|
12
|
+
from _balder.decorator_connect import connect
|
|
13
|
+
from _balder.decorator_covered_by import covered_by
|
|
14
|
+
from _balder.decorator_for_vdevice import for_vdevice
|
|
15
|
+
from _balder.decorator_insert_into_tree import insert_into_tree
|
|
16
|
+
from _balder.decorator_parametrize import parametrize
|
|
17
|
+
from _balder.decorator_parametrize_by_feature import parametrize_by_feature
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
'__version__',
|
|
22
|
+
|
|
23
|
+
'__version_tuple__',
|
|
24
|
+
|
|
25
|
+
'connect',
|
|
26
|
+
|
|
27
|
+
'fixture',
|
|
28
|
+
|
|
29
|
+
'for_vdevice',
|
|
30
|
+
|
|
31
|
+
'insert_into_tree',
|
|
32
|
+
|
|
33
|
+
'covered_by',
|
|
34
|
+
|
|
35
|
+
'parametrize',
|
|
36
|
+
|
|
37
|
+
'parametrize_by_feature',
|
|
38
|
+
|
|
39
|
+
'Setup',
|
|
40
|
+
|
|
41
|
+
'Device',
|
|
42
|
+
|
|
43
|
+
'VDevice',
|
|
44
|
+
|
|
45
|
+
'Feature',
|
|
46
|
+
|
|
47
|
+
'Scenario',
|
|
48
|
+
|
|
49
|
+
'Connection',
|
|
50
|
+
|
|
51
|
+
'BalderPlugin',
|
|
52
|
+
|
|
53
|
+
'BalderSettings',
|
|
54
|
+
|
|
55
|
+
'UnmappedVDevice'
|
|
56
|
+
]
|
balder/connections.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from _balder.objects.connections.osi_1_physical import BluetoothConnection, CanBusConnection, CoaxialCableConnection, \
|
|
4
|
+
DslConnection, RS232Connection, RS422Connection, RS485Connection, IsdnConnection, I2CConnection, I2SConnection, \
|
|
5
|
+
OneWireConnection, OpticalFiberConnection, SpiConnection, TwistedPairCableConnection, UsbConnection, WifiConnection
|
|
6
|
+
from _balder.objects.connections.osi_2_datalink import EthernetConnection, WirelessLanConnection, LLDPConnection, \
|
|
7
|
+
ProfibusConnection
|
|
8
|
+
from _balder.objects.connections.osi_3_network import IpSecConnection, IPv4Connection, IPv6Connection, \
|
|
9
|
+
ICMPv4Connection, ICMPv6Connection, IPConnection, ICMPConnection
|
|
10
|
+
from _balder.objects.connections.osi_4_transport import TcpIPv4Connection, UdpIPv4Connection, TcpIPv6Connection, \
|
|
11
|
+
UdpIPv6Connection, TcpConnection, UdpConnection
|
|
12
|
+
from _balder.objects.connections.osi_5_session import PptpConnection
|
|
13
|
+
from _balder.objects.connections.osi_6_presentation import TelnetConnection
|
|
14
|
+
from _balder.objects.connections.osi_7_application import HttpConnection, ImapConnection, LdapConnection, \
|
|
15
|
+
NtpConnection, RpcConnection, SmtpConnection, SntpConnection, SshConnection, DnsConnection
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
# OSI: Physical Layer
|
|
19
|
+
"BluetoothConnection", "CanBusConnection", "CoaxialCableConnection", "DslConnection", "RS232Connection",
|
|
20
|
+
"RS422Connection", "RS485Connection", "IsdnConnection", "I2CConnection", "I2SConnection", "OneWireConnection",
|
|
21
|
+
"OpticalFiberConnection", "SpiConnection", "TwistedPairCableConnection", "UsbConnection", "WifiConnection",
|
|
22
|
+
|
|
23
|
+
# OSI: Data Link Layer
|
|
24
|
+
"EthernetConnection", "WirelessLanConnection", "LLDPConnection", "ProfibusConnection",
|
|
25
|
+
|
|
26
|
+
# OSI: Network Layer
|
|
27
|
+
"IpSecConnection", "IPv4Connection", "IPv6Connection", "ICMPv4Connection", "ICMPv6Connection",
|
|
28
|
+
"IPConnection", "ICMPConnection",
|
|
29
|
+
|
|
30
|
+
# OSI: Transport Layer
|
|
31
|
+
"TcpIPv4Connection", "UdpIPv4Connection", "TcpIPv6Connection", "UdpIPv6Connection", "TcpConnection",
|
|
32
|
+
"UdpConnection",
|
|
33
|
+
|
|
34
|
+
# OSI: Session Layer
|
|
35
|
+
"PptpConnection",
|
|
36
|
+
|
|
37
|
+
# OSI Presentation Layer
|
|
38
|
+
"TelnetConnection",
|
|
39
|
+
|
|
40
|
+
# OSI Application Layer
|
|
41
|
+
"HttpConnection", "ImapConnection", "LdapConnection", "NtpConnection", "RpcConnection",
|
|
42
|
+
"SmtpConnection", "SntpConnection", "SshConnection", "DnsConnection"
|
|
43
|
+
]
|
balder/devices.py
ADDED
balder/exceptions.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from _balder.exceptions import BalderException, BalderWarning
|
|
2
|
+
from _balder.exceptions import (FixtureScopeError, FixtureReferenceError, UnclearSetupScopedFixtureReference, \
|
|
3
|
+
UnclearUniqueClassReference, LostInExecutorTreeException, DeviceResolvingException, NodeNotExistsError, \
|
|
4
|
+
DuplicateForVDeviceError, DuplicateBalderSettingError, DeviceOverwritingError, VDeviceOverwritingError, \
|
|
5
|
+
AccessToUnmappedVDeviceException, FeatureOverwritingError, UnknownVDeviceException, RoutingBrokenChainError, \
|
|
6
|
+
IllegalConnectionTypeError, ConnectionMetadataConflictError, DeviceScopeError, ConnectionIntersectionError, \
|
|
7
|
+
UnclearAssignableFeatureConnectionError, InheritanceError, MultiInheritanceError, InnerFeatureResolvingError, \
|
|
8
|
+
VDeviceResolvingError, IllegalVDeviceMappingError, MissingFeaturesOfVDeviceError, NotApplicableVariationException, \
|
|
9
|
+
UnclearMethodVariationError, UnexpectedPluginMethodReturnValue)
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
|
|
13
|
+
"BalderException",
|
|
14
|
+
"BalderWarning",
|
|
15
|
+
"FixtureScopeError",
|
|
16
|
+
"FixtureReferenceError",
|
|
17
|
+
"UnclearSetupScopedFixtureReference",
|
|
18
|
+
"UnclearUniqueClassReference",
|
|
19
|
+
"LostInExecutorTreeException",
|
|
20
|
+
"DeviceResolvingException",
|
|
21
|
+
"NodeNotExistsError",
|
|
22
|
+
"DuplicateForVDeviceError",
|
|
23
|
+
"DuplicateBalderSettingError",
|
|
24
|
+
"DeviceOverwritingError",
|
|
25
|
+
"VDeviceOverwritingError",
|
|
26
|
+
"AccessToUnmappedVDeviceException",
|
|
27
|
+
"FeatureOverwritingError",
|
|
28
|
+
"UnknownVDeviceException",
|
|
29
|
+
"RoutingBrokenChainError",
|
|
30
|
+
"IllegalConnectionTypeError",
|
|
31
|
+
"ConnectionMetadataConflictError",
|
|
32
|
+
"DeviceScopeError",
|
|
33
|
+
"ConnectionIntersectionError",
|
|
34
|
+
"UnclearAssignableFeatureConnectionError",
|
|
35
|
+
"InheritanceError",
|
|
36
|
+
"MultiInheritanceError",
|
|
37
|
+
"InnerFeatureResolvingError",
|
|
38
|
+
"VDeviceResolvingError",
|
|
39
|
+
"IllegalVDeviceMappingError",
|
|
40
|
+
"MissingFeaturesOfVDeviceError",
|
|
41
|
+
"NotApplicableVariationException",
|
|
42
|
+
"UnclearMethodVariationError",
|
|
43
|
+
"UnexpectedPluginMethodReturnValue",
|
|
44
|
+
]
|