armodel 1.7.9__py3-none-any.whl → 1.8.1__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.
- armodel/cli/arxml_format_cli.py +1 -0
- armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +50 -12
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +14 -14
- armodel/models/M2/AUTOSARTemplates/CommonStructure/FlatMap.py +2 -3
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Implementation.py +1 -1
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py +36 -34
- armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +1 -1
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ModeDeclaration.py +4 -4
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/__init__.py +3 -3
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +5 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/ExecutionOrderConstraint.py +3 -3
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/TimingExtensions.py +3 -3
- armodel/models/M2/AUTOSARTemplates/ECUCDescriptionTemplate.py +86 -9
- armodel/models/M2/AUTOSARTemplates/ECUCParameterDefTemplate.py +1249 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/AbstractStructure.py +13 -10
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +238 -225
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ArObject.py +5 -4
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +46 -25
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +38 -3
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +18 -20
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py +23 -19
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/EndToEndProtection.py +4 -4
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +71 -27
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +27 -17
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +172 -128
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +11 -10
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreCommunication.py +11 -11
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +16 -10
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +2 -2
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/NetworkManagement.py +6 -6
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/RteEventToOsTaskMapping.py +35 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/SWmapping.py +25 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/SecureCommunication.py +83 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +90 -38
- armodel/models/M2/MSR/AsamHdo/AdminData.py +101 -8
- armodel/models/__init__.py +2 -0
- armodel/models/utils/__init__.py +0 -0
- armodel/models/utils/uuid_mgr.py +23 -0
- armodel/parser/abstract_arxml_parser.py +13 -5
- armodel/parser/arxml_parser.py +412 -85
- armodel/tests/test_armodel/models/test_ECUCParameterDefTemplate.py +116 -0
- armodel/tests/test_armodel/models/test_Identifiable.py +85 -0
- armodel/tests/test_armodel/models/test_ar_object.py +85 -86
- armodel/tests/test_armodel/models/test_ar_package.py +70 -70
- armodel/tests/test_armodel/models/test_ar_ref.py +36 -36
- armodel/tests/test_armodel/models/test_common_structure.py +37 -35
- armodel/tests/test_armodel/models/test_datatype.py +140 -142
- armodel/tests/test_armodel/models/test_general_structure.py +19 -18
- armodel/tests/test_armodel/models/test_port_interface.py +2 -6
- armodel/tests/test_armodel/parser/test_arxml_parser.py +8 -8
- armodel/writer/abstract_arxml_writer.py +6 -2
- armodel/writer/arxml_writer.py +414 -57
- {armodel-1.7.9.dist-info → armodel-1.8.1.dist-info}/METADATA +31 -1
- {armodel-1.7.9.dist-info → armodel-1.8.1.dist-info}/RECORD +58 -51
- {armodel-1.7.9.dist-info → armodel-1.8.1.dist-info}/LICENSE +0 -0
- {armodel-1.7.9.dist-info → armodel-1.8.1.dist-info}/WHEEL +0 -0
- {armodel-1.7.9.dist-info → armodel-1.8.1.dist-info}/entry_points.txt +0 -0
- {armodel-1.7.9.dist-info → armodel-1.8.1.dist-info}/top_level.txt +0 -0
|
@@ -8,12 +8,14 @@ from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Iden
|
|
|
8
8
|
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable, MultilanguageReferrable, Referrable
|
|
9
9
|
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
10
10
|
from ....models.M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import ImplementationDataType
|
|
11
|
-
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.Components import ApplicationSwComponentType, AtomicSwComponentType
|
|
11
|
+
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.Components import ApplicationSwComponentType, AtomicSwComponentType
|
|
12
|
+
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.Components import EcuAbstractionSwComponentType, SwComponentType
|
|
12
13
|
from ....models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
|
|
13
14
|
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import DataTypeMappingSet
|
|
14
15
|
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement
|
|
15
16
|
from ....models.M2.MSR.AsamHdo.ComputationMethod import CompuMethod
|
|
16
|
-
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ClientServerInterface, DataInterface, PortInterface
|
|
17
|
+
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ClientServerInterface, DataInterface, PortInterface
|
|
18
|
+
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import SenderReceiverInterface
|
|
17
19
|
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.Components import ServiceSwComponentType
|
|
18
20
|
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.Components import CompositionSwComponentType
|
|
19
21
|
|
|
@@ -36,6 +38,7 @@ class TestAUTOSAR:
|
|
|
36
38
|
|
|
37
39
|
def test_autosar(self):
|
|
38
40
|
document = AUTOSAR.getInstance()
|
|
41
|
+
document.clear()
|
|
39
42
|
assert (isinstance(document, CollectableElement))
|
|
40
43
|
assert (isinstance(document, AUTOSAR))
|
|
41
44
|
assert (len(document.getARPackages()) == 0)
|
|
@@ -52,10 +55,10 @@ class TestAUTOSAR:
|
|
|
52
55
|
ar_package = document.find("/sw_package")
|
|
53
56
|
assert ("sw_package" == ar_package.short_name)
|
|
54
57
|
|
|
55
|
-
assert(isinstance(ar_package, ARObject))
|
|
56
|
-
assert(isinstance(ar_package, Identifiable))
|
|
57
|
-
assert(isinstance(ar_package, Referrable))
|
|
58
|
-
assert(isinstance(ar_package, MultilanguageReferrable))
|
|
58
|
+
assert (isinstance(ar_package, ARObject))
|
|
59
|
+
assert (isinstance(ar_package, Identifiable))
|
|
60
|
+
assert (isinstance(ar_package, Referrable))
|
|
61
|
+
assert (isinstance(ar_package, MultilanguageReferrable))
|
|
59
62
|
|
|
60
63
|
|
|
61
64
|
class TestARPackage:
|
|
@@ -73,8 +76,7 @@ class TestARPackage:
|
|
|
73
76
|
|
|
74
77
|
ar_package_level2 = ar_package_level1.createARPackage("package_level2")
|
|
75
78
|
assert (ar_package_level2.short_name == 'package_level2')
|
|
76
|
-
assert (ar_package_level2.full_name ==
|
|
77
|
-
"/package_level1/package_level2")
|
|
79
|
+
assert (ar_package_level2.full_name == "/package_level1/package_level2")
|
|
78
80
|
assert (len(ar_package_level1.getARPackages()) == 1)
|
|
79
81
|
assert (ar_package_level1.getARPackages()[0] == ar_package_level2)
|
|
80
82
|
|
|
@@ -85,13 +87,11 @@ class TestARPackage:
|
|
|
85
87
|
def test_createEcuAbstractionSwComponentType(self):
|
|
86
88
|
document = AUTOSAR.getInstance()
|
|
87
89
|
ar_root = document.createARPackage("AUTOSAR")
|
|
88
|
-
sw_component_type = ar_root.createEcuAbstractionSwComponentType(
|
|
89
|
-
|
|
90
|
-
assert(sw_component_type
|
|
91
|
-
assert(isinstance(sw_component_type, EcuAbstractionSwComponentType))
|
|
90
|
+
sw_component_type = ar_root.createEcuAbstractionSwComponentType("ecu_abstract_sw_component")
|
|
91
|
+
assert (sw_component_type.short_name == "ecu_abstract_sw_component")
|
|
92
|
+
assert (isinstance(sw_component_type, EcuAbstractionSwComponentType))
|
|
92
93
|
|
|
93
|
-
find_component_type = document.find(
|
|
94
|
-
"/AUTOSAR/ecu_abstract_sw_component")
|
|
94
|
+
find_component_type = document.find("/AUTOSAR/ecu_abstract_sw_component")
|
|
95
95
|
assert (find_component_type == sw_component_type)
|
|
96
96
|
assert (find_component_type.short_name == "ecu_abstract_sw_component")
|
|
97
97
|
|
|
@@ -100,17 +100,17 @@ class TestARPackage:
|
|
|
100
100
|
ar_root = document.createARPackage("AUTOSAR")
|
|
101
101
|
sw_component_type = ar_root.createApplicationSwComponentType(
|
|
102
102
|
"application_sw_component")
|
|
103
|
-
assert(sw_component_type.short_name == "application_sw_component")
|
|
104
|
-
|
|
105
|
-
assert(isinstance(sw_component_type, ARElement))
|
|
106
|
-
assert(isinstance(sw_component_type, AtomicSwComponentType))
|
|
107
|
-
assert(isinstance(sw_component_type, CollectableElement))
|
|
108
|
-
assert(isinstance(sw_component_type, Identifiable))
|
|
109
|
-
assert(isinstance(sw_component_type, MultilanguageReferrable))
|
|
110
|
-
assert(isinstance(sw_component_type, PackageableElement))
|
|
111
|
-
assert(isinstance(sw_component_type, Referrable))
|
|
112
|
-
assert(isinstance(sw_component_type, SwComponentType))
|
|
113
|
-
assert(isinstance(sw_component_type, ApplicationSwComponentType))
|
|
103
|
+
assert (sw_component_type.short_name == "application_sw_component")
|
|
104
|
+
|
|
105
|
+
assert (isinstance(sw_component_type, ARElement))
|
|
106
|
+
assert (isinstance(sw_component_type, AtomicSwComponentType))
|
|
107
|
+
assert (isinstance(sw_component_type, CollectableElement))
|
|
108
|
+
assert (isinstance(sw_component_type, Identifiable))
|
|
109
|
+
assert (isinstance(sw_component_type, MultilanguageReferrable))
|
|
110
|
+
assert (isinstance(sw_component_type, PackageableElement))
|
|
111
|
+
assert (isinstance(sw_component_type, Referrable))
|
|
112
|
+
assert (isinstance(sw_component_type, SwComponentType))
|
|
113
|
+
assert (isinstance(sw_component_type, ApplicationSwComponentType))
|
|
114
114
|
|
|
115
115
|
find_component_type = document.find(
|
|
116
116
|
"/AUTOSAR/application_sw_component")
|
|
@@ -122,17 +122,17 @@ class TestARPackage:
|
|
|
122
122
|
ar_root = document.createARPackage("AUTOSAR")
|
|
123
123
|
sw_component_type = ar_root.createServiceSwComponentType(
|
|
124
124
|
"service_sw_component")
|
|
125
|
-
assert(sw_component_type.short_name == "service_sw_component")
|
|
126
|
-
|
|
127
|
-
assert(isinstance(sw_component_type, ARElement))
|
|
128
|
-
assert(isinstance(sw_component_type, AtomicSwComponentType))
|
|
129
|
-
assert(isinstance(sw_component_type, CollectableElement))
|
|
130
|
-
assert(isinstance(sw_component_type, Identifiable))
|
|
131
|
-
assert(isinstance(sw_component_type, MultilanguageReferrable))
|
|
132
|
-
assert(isinstance(sw_component_type, PackageableElement))
|
|
133
|
-
assert(isinstance(sw_component_type, Referrable))
|
|
134
|
-
assert(isinstance(sw_component_type, SwComponentType))
|
|
135
|
-
assert(isinstance(sw_component_type, ServiceSwComponentType))
|
|
125
|
+
assert (sw_component_type.short_name == "service_sw_component")
|
|
126
|
+
|
|
127
|
+
assert (isinstance(sw_component_type, ARElement))
|
|
128
|
+
assert (isinstance(sw_component_type, AtomicSwComponentType))
|
|
129
|
+
assert (isinstance(sw_component_type, CollectableElement))
|
|
130
|
+
assert (isinstance(sw_component_type, Identifiable))
|
|
131
|
+
assert (isinstance(sw_component_type, MultilanguageReferrable))
|
|
132
|
+
assert (isinstance(sw_component_type, PackageableElement))
|
|
133
|
+
assert (isinstance(sw_component_type, Referrable))
|
|
134
|
+
assert (isinstance(sw_component_type, SwComponentType))
|
|
135
|
+
assert (isinstance(sw_component_type, ServiceSwComponentType))
|
|
136
136
|
|
|
137
137
|
find_component_type = document.find("/AUTOSAR/service_sw_component")
|
|
138
138
|
assert (find_component_type == sw_component_type)
|
|
@@ -143,16 +143,16 @@ class TestARPackage:
|
|
|
143
143
|
ar_root = document.createARPackage("AUTOSAR")
|
|
144
144
|
sw_component_type = ar_root.createCompositionSwComponentType(
|
|
145
145
|
"composition_sw_component")
|
|
146
|
-
assert(sw_component_type.short_name == "composition_sw_component")
|
|
146
|
+
assert (sw_component_type.short_name == "composition_sw_component")
|
|
147
147
|
|
|
148
|
-
assert(isinstance(sw_component_type, ARElement))
|
|
149
|
-
assert(isinstance(sw_component_type, CollectableElement))
|
|
150
|
-
assert(isinstance(sw_component_type, Identifiable))
|
|
151
|
-
assert(isinstance(sw_component_type, MultilanguageReferrable))
|
|
152
|
-
assert(isinstance(sw_component_type, PackageableElement))
|
|
153
|
-
assert(isinstance(sw_component_type, Referrable))
|
|
154
|
-
assert(isinstance(sw_component_type, SwComponentType))
|
|
155
|
-
assert(isinstance(sw_component_type, CompositionSwComponentType))
|
|
148
|
+
assert (isinstance(sw_component_type, ARElement))
|
|
149
|
+
assert (isinstance(sw_component_type, CollectableElement))
|
|
150
|
+
assert (isinstance(sw_component_type, Identifiable))
|
|
151
|
+
assert (isinstance(sw_component_type, MultilanguageReferrable))
|
|
152
|
+
assert (isinstance(sw_component_type, PackageableElement))
|
|
153
|
+
assert (isinstance(sw_component_type, Referrable))
|
|
154
|
+
assert (isinstance(sw_component_type, SwComponentType))
|
|
155
|
+
assert (isinstance(sw_component_type, CompositionSwComponentType))
|
|
156
156
|
|
|
157
157
|
find_component_type = document.find(
|
|
158
158
|
"/AUTOSAR/composition_sw_component")
|
|
@@ -164,17 +164,17 @@ class TestARPackage:
|
|
|
164
164
|
ar_root = document.createARPackage("AUTOSAR")
|
|
165
165
|
instance_if = ar_root.createSenderReceiverInterface(
|
|
166
166
|
"sender_receiver_interface")
|
|
167
|
-
assert(instance_if.short_name == "sender_receiver_interface")
|
|
168
|
-
|
|
169
|
-
assert(isinstance(instance_if, ARElement))
|
|
170
|
-
assert(isinstance(instance_if, CollectableElement))
|
|
171
|
-
assert(isinstance(instance_if, DataInterface))
|
|
172
|
-
assert(isinstance(instance_if, Identifiable))
|
|
173
|
-
assert(isinstance(instance_if, MultilanguageReferrable))
|
|
174
|
-
assert(isinstance(instance_if, PackageableElement))
|
|
175
|
-
assert(isinstance(instance_if, PortInterface))
|
|
176
|
-
assert(isinstance(instance_if, Referrable))
|
|
177
|
-
assert(isinstance(instance_if, SenderReceiverInterface))
|
|
167
|
+
assert (instance_if.short_name == "sender_receiver_interface")
|
|
168
|
+
|
|
169
|
+
assert (isinstance(instance_if, ARElement))
|
|
170
|
+
assert (isinstance(instance_if, CollectableElement))
|
|
171
|
+
assert (isinstance(instance_if, DataInterface))
|
|
172
|
+
assert (isinstance(instance_if, Identifiable))
|
|
173
|
+
assert (isinstance(instance_if, MultilanguageReferrable))
|
|
174
|
+
assert (isinstance(instance_if, PackageableElement))
|
|
175
|
+
assert (isinstance(instance_if, PortInterface))
|
|
176
|
+
assert (isinstance(instance_if, Referrable))
|
|
177
|
+
assert (isinstance(instance_if, SenderReceiverInterface))
|
|
178
178
|
|
|
179
179
|
find_component = document.find("/AUTOSAR/sender_receiver_interface")
|
|
180
180
|
assert (find_component == instance_if)
|
|
@@ -190,8 +190,8 @@ class TestARPackage:
|
|
|
190
190
|
ar_root = document.createARPackage("AUTOSAR")
|
|
191
191
|
instance_if = ar_root.createClientServerInterface(
|
|
192
192
|
"client_server_interface")
|
|
193
|
-
assert(instance_if.short_name == "client_server_interface")
|
|
194
|
-
assert(isinstance(instance_if, ClientServerInterface))
|
|
193
|
+
assert (instance_if.short_name == "client_server_interface")
|
|
194
|
+
assert (isinstance(instance_if, ClientServerInterface))
|
|
195
195
|
|
|
196
196
|
find_component = document.find("/AUTOSAR/client_server_interface")
|
|
197
197
|
assert (find_component == instance_if)
|
|
@@ -207,8 +207,8 @@ class TestARPackage:
|
|
|
207
207
|
ar_root = document.createARPackage("AUTOSAR")
|
|
208
208
|
data_type = ar_root.createApplicationPrimitiveDataType(
|
|
209
209
|
"application_primitive_data_type")
|
|
210
|
-
assert(data_type.short_name == "application_primitive_data_type")
|
|
211
|
-
assert(isinstance(data_type, ApplicationPrimitiveDataType))
|
|
210
|
+
assert (data_type.short_name == "application_primitive_data_type")
|
|
211
|
+
assert (isinstance(data_type, ApplicationPrimitiveDataType))
|
|
212
212
|
|
|
213
213
|
find_component = document.find(
|
|
214
214
|
"/AUTOSAR/application_primitive_data_type")
|
|
@@ -225,8 +225,8 @@ class TestARPackage:
|
|
|
225
225
|
ar_root = document.createARPackage("AUTOSAR")
|
|
226
226
|
data_type = ar_root.createApplicationRecordDataType(
|
|
227
227
|
"application_record_data_type")
|
|
228
|
-
assert(data_type.short_name == "application_record_data_type")
|
|
229
|
-
assert(isinstance(data_type, ApplicationRecordDataType))
|
|
228
|
+
assert (data_type.short_name == "application_record_data_type")
|
|
229
|
+
assert (isinstance(data_type, ApplicationRecordDataType))
|
|
230
230
|
|
|
231
231
|
find_component = document.find("/AUTOSAR/application_record_data_type")
|
|
232
232
|
assert (find_component == data_type)
|
|
@@ -237,8 +237,8 @@ class TestARPackage:
|
|
|
237
237
|
ar_root = document.createARPackage("AUTOSAR")
|
|
238
238
|
data_type = ar_root.createImplementationDataType(
|
|
239
239
|
"implementation_data_type")
|
|
240
|
-
assert(data_type.short_name == "implementation_data_type")
|
|
241
|
-
assert(isinstance(data_type, ImplementationDataType))
|
|
240
|
+
assert (data_type.short_name == "implementation_data_type")
|
|
241
|
+
assert (isinstance(data_type, ImplementationDataType))
|
|
242
242
|
|
|
243
243
|
find_component = document.find("/AUTOSAR/implementation_data_type")
|
|
244
244
|
assert (find_component == data_type)
|
|
@@ -253,8 +253,8 @@ class TestARPackage:
|
|
|
253
253
|
document = AUTOSAR.getInstance()
|
|
254
254
|
ar_root = document.createARPackage("AUTOSAR")
|
|
255
255
|
data_type = ar_root.createSwBaseType("sw_base_type")
|
|
256
|
-
assert(data_type.short_name == "sw_base_type")
|
|
257
|
-
assert(isinstance(data_type, SwBaseType))
|
|
256
|
+
assert (data_type.short_name == "sw_base_type")
|
|
257
|
+
assert (isinstance(data_type, SwBaseType))
|
|
258
258
|
|
|
259
259
|
find_component = document.find("/AUTOSAR/sw_base_type")
|
|
260
260
|
assert (find_component == data_type)
|
|
@@ -268,8 +268,8 @@ class TestARPackage:
|
|
|
268
268
|
document = AUTOSAR.getInstance()
|
|
269
269
|
ar_root = document.createARPackage("AUTOSAR")
|
|
270
270
|
mapping_set = ar_root.createDataTypeMappingSet("data_type_mapping_set")
|
|
271
|
-
assert(mapping_set.short_name == "data_type_mapping_set")
|
|
272
|
-
assert(isinstance(mapping_set, DataTypeMappingSet))
|
|
271
|
+
assert (mapping_set.short_name == "data_type_mapping_set")
|
|
272
|
+
assert (isinstance(mapping_set, DataTypeMappingSet))
|
|
273
273
|
|
|
274
274
|
find_component = document.find("/AUTOSAR/data_type_mapping_set")
|
|
275
275
|
assert (find_component == mapping_set)
|
|
@@ -284,8 +284,8 @@ class TestARPackage:
|
|
|
284
284
|
document = AUTOSAR.getInstance()
|
|
285
285
|
ar_root = document.createARPackage("AUTOSAR")
|
|
286
286
|
compu_method = ar_root.createCompuMethod("compu_method")
|
|
287
|
-
assert(compu_method.short_name == "compu_method")
|
|
288
|
-
assert(isinstance(compu_method, CompuMethod))
|
|
287
|
+
assert (compu_method.short_name == "compu_method")
|
|
288
|
+
assert (isinstance(compu_method, CompuMethod))
|
|
289
289
|
|
|
290
290
|
find_component = document.find("/AUTOSAR/compu_method")
|
|
291
291
|
assert (find_component == compu_method)
|
|
@@ -14,68 +14,68 @@ from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArOb
|
|
|
14
14
|
class TestARRef:
|
|
15
15
|
def test_RefType(self):
|
|
16
16
|
ref_type = RefType()
|
|
17
|
-
assert(ref_type.getBase() == None)
|
|
18
|
-
assert(ref_type.getValue() == None)
|
|
19
|
-
assert(ref_type.getDest() == None)
|
|
17
|
+
assert (ref_type.getBase() == None)
|
|
18
|
+
assert (ref_type.getValue() == None)
|
|
19
|
+
assert (ref_type.getDest() == None)
|
|
20
20
|
|
|
21
21
|
def test_TRefType(self):
|
|
22
22
|
ref_type = TRefType()
|
|
23
|
-
assert(ref_type.getBase() == None)
|
|
24
|
-
assert(ref_type.getValue() == None)
|
|
25
|
-
assert(ref_type.getDest() == None)
|
|
26
|
-
|
|
23
|
+
assert (ref_type.getBase() == None)
|
|
24
|
+
assert (ref_type.getValue() == None)
|
|
25
|
+
assert (ref_type.getDest() == None)
|
|
27
26
|
|
|
28
27
|
def test_AutosarVariableRef(self):
|
|
29
28
|
ref_type = AutosarVariableRef()
|
|
30
|
-
assert(ref_type != None)
|
|
31
|
-
assert(ref_type.autosarVariableIRef == None)
|
|
32
|
-
assert(ref_type.autosarVariableInImplDatatype == None)
|
|
33
|
-
assert(ref_type.localVariableRef == None)
|
|
29
|
+
assert (ref_type != None)
|
|
30
|
+
assert (ref_type.autosarVariableIRef == None)
|
|
31
|
+
assert (ref_type.autosarVariableInImplDatatype == None)
|
|
32
|
+
assert (ref_type.localVariableRef == None)
|
|
34
33
|
|
|
35
34
|
def test_AtpInstanceRef(self):
|
|
36
35
|
with pytest.raises(NotImplementedError) as err:
|
|
37
36
|
ref_type = AtpInstanceRef()
|
|
38
|
-
assert(str(err.value) == "AtpInstanceRef is an abstract class.")
|
|
37
|
+
assert (str(err.value) == "AtpInstanceRef is an abstract class.")
|
|
39
38
|
|
|
40
39
|
def test_ProvidedPortPrototypeInstanceRef(self):
|
|
41
40
|
ref_type = PPortInCompositionInstanceRef()
|
|
42
|
-
assert(ref_type != None)
|
|
43
|
-
assert(ref_type.getContextComponentRef() == None)
|
|
44
|
-
assert(ref_type.getTargetPPortRef() == None)
|
|
41
|
+
assert (ref_type != None)
|
|
42
|
+
assert (ref_type.getContextComponentRef() == None)
|
|
43
|
+
assert (ref_type.getTargetPPortRef() == None)
|
|
45
44
|
|
|
46
45
|
def test_RequiredPortPrototypeInstanceRef(self):
|
|
47
46
|
ref_type = RPortInCompositionInstanceRef()
|
|
48
|
-
assert(ref_type != None)
|
|
49
|
-
assert(ref_type.getContextComponentRef() == None)
|
|
50
|
-
assert(ref_type.getTargetRPortRef() == None)
|
|
47
|
+
assert (ref_type != None)
|
|
48
|
+
assert (ref_type.getContextComponentRef() == None)
|
|
49
|
+
assert (ref_type.getTargetRPortRef() == None)
|
|
51
50
|
|
|
52
51
|
def test_ArVariableInImplementationDataInstanceRef(self):
|
|
53
52
|
ref_type = ArVariableInImplementationDataInstanceRef()
|
|
54
|
-
assert(ref_type != None)
|
|
55
|
-
assert(ref_type.getPortPrototypeRef() == None)
|
|
56
|
-
assert(ref_type.getTargetDataPrototypeRef() == None)
|
|
53
|
+
assert (ref_type != None)
|
|
54
|
+
assert (ref_type.getPortPrototypeRef() == None)
|
|
55
|
+
assert (ref_type.getTargetDataPrototypeRef() == None)
|
|
57
56
|
|
|
58
57
|
def test_OperationInAtomicSwcInstanceRef(self):
|
|
59
58
|
with pytest.raises(NotImplementedError) as err:
|
|
60
59
|
_ = OperationInAtomicSwcInstanceRef()
|
|
61
|
-
assert(str(err.value) ==
|
|
60
|
+
assert (str(err.value) ==
|
|
61
|
+
"OperationInAtomicSwcInstanceRef is an abstract class.")
|
|
62
62
|
|
|
63
63
|
def test_POperationInAtomicSwcInstanceRef(self):
|
|
64
64
|
ref_type = POperationInAtomicSwcInstanceRef()
|
|
65
|
-
assert(isinstance(ref_type, ARObject))
|
|
66
|
-
assert(isinstance(ref_type, AtpInstanceRef))
|
|
67
|
-
assert(isinstance(ref_type, OperationInAtomicSwcInstanceRef))
|
|
68
|
-
assert(isinstance(ref_type, POperationInAtomicSwcInstanceRef))
|
|
69
|
-
assert(ref_type != None)
|
|
70
|
-
assert(ref_type.getContextPPortRef() == None)
|
|
71
|
-
assert(ref_type.getTargetProvidedOperationRef() == None)
|
|
65
|
+
assert (isinstance(ref_type, ARObject))
|
|
66
|
+
assert (isinstance(ref_type, AtpInstanceRef))
|
|
67
|
+
assert (isinstance(ref_type, OperationInAtomicSwcInstanceRef))
|
|
68
|
+
assert (isinstance(ref_type, POperationInAtomicSwcInstanceRef))
|
|
69
|
+
assert (ref_type != None)
|
|
70
|
+
assert (ref_type.getContextPPortRef() == None)
|
|
71
|
+
assert (ref_type.getTargetProvidedOperationRef() == None)
|
|
72
72
|
|
|
73
73
|
def test_ROperationInAtomicSwcInstanceRef(self):
|
|
74
74
|
ref_type = ROperationInAtomicSwcInstanceRef()
|
|
75
|
-
assert(isinstance(ref_type, ARObject))
|
|
76
|
-
assert(isinstance(ref_type, AtpInstanceRef))
|
|
77
|
-
assert(isinstance(ref_type, OperationInAtomicSwcInstanceRef))
|
|
78
|
-
assert(isinstance(ref_type, ROperationInAtomicSwcInstanceRef))
|
|
79
|
-
assert(ref_type != None)
|
|
80
|
-
assert(ref_type.getContextRPortRef() == None)
|
|
81
|
-
assert(ref_type.getTargetRequiredOperationRef() == None)
|
|
75
|
+
assert (isinstance(ref_type, ARObject))
|
|
76
|
+
assert (isinstance(ref_type, AtpInstanceRef))
|
|
77
|
+
assert (isinstance(ref_type, OperationInAtomicSwcInstanceRef))
|
|
78
|
+
assert (isinstance(ref_type, ROperationInAtomicSwcInstanceRef))
|
|
79
|
+
assert (ref_type != None)
|
|
80
|
+
assert (ref_type.getContextRPortRef() == None)
|
|
81
|
+
assert (ref_type.getTargetRequiredOperationRef() == None)
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
|
+
from ....models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
|
|
3
4
|
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import CollectableElement
|
|
4
|
-
|
|
5
5
|
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable, MultilanguageReferrable, Referrable
|
|
6
|
-
|
|
7
6
|
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
8
|
-
|
|
9
|
-
from ....models.M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import
|
|
10
|
-
from .... import AUTOSAR
|
|
7
|
+
from ....models.M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import AbstractImplementationDataTypeElement
|
|
8
|
+
from ....models.M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import ImplementationDataTypeElement
|
|
11
9
|
from ....models.M2.AUTOSARTemplates.CommonStructure import ConstantReference, ConstantSpecification, ValueSpecification
|
|
12
10
|
from ....models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import ExecutableEntity
|
|
13
11
|
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement
|
|
14
12
|
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import PackageableElement
|
|
15
13
|
|
|
14
|
+
|
|
16
15
|
class Test_M2_AUTOSARTemplates_CommonStructure_Constants:
|
|
17
|
-
|
|
16
|
+
|
|
18
17
|
def test_ValueSpecification(self):
|
|
19
18
|
with pytest.raises(NotImplementedError) as err:
|
|
20
19
|
ValueSpecification()
|
|
21
|
-
assert(str(err.value) == "ValueSpecification is an abstract class.")
|
|
20
|
+
assert (str(err.value) == "ValueSpecification is an abstract class.")
|
|
22
21
|
|
|
23
22
|
def test_ConstantSpecification(self):
|
|
24
23
|
document = AUTOSAR.getInstance()
|
|
25
24
|
ar_root = document.createARPackage("AUTOSAR")
|
|
26
25
|
spec = ConstantSpecification(ar_root, "constant")
|
|
27
|
-
|
|
28
|
-
assert(isinstance(spec, ARElement))
|
|
29
|
-
assert(isinstance(spec, ARObject))
|
|
30
|
-
assert(isinstance(spec, CollectableElement))
|
|
31
|
-
assert(isinstance(spec, Identifiable))
|
|
32
|
-
assert(isinstance(spec, MultilanguageReferrable))
|
|
33
|
-
assert(isinstance(spec, PackageableElement))
|
|
34
|
-
assert(isinstance(spec, Referrable))
|
|
35
|
-
assert(isinstance(spec, ConstantSpecification))
|
|
26
|
+
|
|
27
|
+
assert (isinstance(spec, ARElement))
|
|
28
|
+
assert (isinstance(spec, ARObject))
|
|
29
|
+
assert (isinstance(spec, CollectableElement))
|
|
30
|
+
assert (isinstance(spec, Identifiable))
|
|
31
|
+
assert (isinstance(spec, MultilanguageReferrable))
|
|
32
|
+
assert (isinstance(spec, PackageableElement))
|
|
33
|
+
assert (isinstance(spec, Referrable))
|
|
34
|
+
assert (isinstance(spec, ConstantSpecification))
|
|
36
35
|
|
|
37
36
|
def test_ConstantReference(self):
|
|
38
37
|
ref = ConstantReference()
|
|
39
38
|
|
|
40
|
-
assert(ref.getConstantRef()
|
|
39
|
+
assert (ref.getConstantRef() is None)
|
|
40
|
+
|
|
41
|
+
assert (isinstance(ref, ARObject))
|
|
42
|
+
assert (isinstance(ref, ValueSpecification))
|
|
43
|
+
assert (isinstance(ref, ConstantReference))
|
|
41
44
|
|
|
42
|
-
assert(isinstance(ref, ARObject))
|
|
43
|
-
assert(isinstance(ref, ValueSpecification))
|
|
44
|
-
assert(isinstance(ref, ConstantReference))
|
|
45
45
|
|
|
46
46
|
class Test_M2_AUTOSARTemplates_CommonStructure_InternalBehavior:
|
|
47
47
|
def test_ExecutableEntity(self):
|
|
@@ -49,32 +49,34 @@ class Test_M2_AUTOSARTemplates_CommonStructure_InternalBehavior:
|
|
|
49
49
|
ar_root = document.createARPackage("AUTOSAR")
|
|
50
50
|
with pytest.raises(NotImplementedError) as err:
|
|
51
51
|
ExecutableEntity(ar_root, "ExecutableEntity")
|
|
52
|
-
assert(str(err.value) == "ExecutableEntity is an abstract class.")
|
|
52
|
+
assert (str(err.value) == "ExecutableEntity is an abstract class.")
|
|
53
|
+
|
|
53
54
|
|
|
54
55
|
class Test_M2_AUTOSARTemplates_CommonStructure_ImplementationDataTypes:
|
|
55
56
|
def test_ImplementationDataTypeElement(self):
|
|
56
57
|
document = AUTOSAR.getInstance()
|
|
57
58
|
ar_root = document.createARPackage("AUTOSAR")
|
|
58
|
-
data_type = ImplementationDataTypeElement(
|
|
59
|
+
data_type = ImplementationDataTypeElement(
|
|
60
|
+
ar_root, "implementation_data_type")
|
|
59
61
|
|
|
60
|
-
assert(data_type.getShortName() == "implementation_data_type")
|
|
61
|
-
assert(data_type.getArraySize()
|
|
62
|
-
assert(data_type.getIsOptional()
|
|
62
|
+
assert (data_type.getShortName() == "implementation_data_type")
|
|
63
|
+
assert (data_type.getArraySize() is None)
|
|
64
|
+
assert (data_type.getIsOptional() is None)
|
|
63
65
|
|
|
64
|
-
assert(isinstance(data_type, ARObject))
|
|
65
|
-
assert(isinstance(data_type, AbstractImplementationDataTypeElement))
|
|
66
|
+
assert (isinstance(data_type, ARObject))
|
|
67
|
+
assert (isinstance(data_type, AbstractImplementationDataTypeElement))
|
|
66
68
|
# assert(isinstance(data_type, AtpClassifier))
|
|
67
69
|
# assert(isinstance(data_type, AtpFeature))
|
|
68
70
|
# assert(isinstance(data_type, AtpStructureElement))
|
|
69
|
-
assert(isinstance(data_type, Identifiable))
|
|
70
|
-
assert(isinstance(data_type, MultilanguageReferrable))
|
|
71
|
-
assert(isinstance(data_type, Referrable))
|
|
72
|
-
assert(isinstance(data_type, ImplementationDataTypeElement))
|
|
71
|
+
assert (isinstance(data_type, Identifiable))
|
|
72
|
+
assert (isinstance(data_type, MultilanguageReferrable))
|
|
73
|
+
assert (isinstance(data_type, Referrable))
|
|
74
|
+
assert (isinstance(data_type, ImplementationDataTypeElement))
|
|
73
75
|
|
|
74
76
|
sub_type = data_type.createImplementationDataTypeElement("sub_type")
|
|
75
|
-
assert(sub_type.getShortName() == "sub_type")
|
|
76
|
-
assert(isinstance(sub_type, ImplementationDataTypeElement))
|
|
77
|
+
assert (sub_type.getShortName() == "sub_type")
|
|
78
|
+
assert (isinstance(sub_type, ImplementationDataTypeElement))
|
|
77
79
|
|
|
78
|
-
assert(len(data_type.getImplementationDataTypeElements()) == 1)
|
|
80
|
+
assert (len(data_type.getImplementationDataTypeElements()) == 1)
|
|
79
81
|
sub_type2 = data_type.getImplementationDataTypeElements()[0]
|
|
80
|
-
assert(sub_type == sub_type2)
|
|
82
|
+
assert (sub_type == sub_type2)
|