@@ -145,8 +145,7 @@ def test_delete_and_post_aas(self):
145
145
aas_identifier = string_to_base64url ("https://acplt.org/Test_AssetAdministrationShell" ))
146
146
self .aasRepoClient .delete_asset_administration_shell_by_id (
147
147
aas_identifier = string_to_base64url ("https://acplt.org/Test_AssetAdministrationShell" ))
148
- retrieved_aas_parsed = AASClientTest ._parse_object (object = retrieved_aas , encoder = AASToJsonEncoder )
149
- self .aasRepoClient .post_asset_administration_shell (retrieved_aas_parsed )
148
+ self .aasRepoClient .post_asset_administration_shell (retrieved_aas )
150
149
retrieved_aas_new = self .aasRepoClient .get_asset_administration_shell_by_id (
151
150
aas_identifier = string_to_base64url ("https://acplt.org/Test_AssetAdministrationShell" ))
152
151
self .CHECKER .check_asset_administration_shell_equal (retrieved_aas , retrieved_aas_new )
@@ -165,14 +164,13 @@ def test_delete_and_post_aas_errors(self):
165
164
166
165
self .aasRepoClient .delete_asset_administration_shell_by_id (
167
166
aas_identifier = string_to_base64url ("https://acplt.org/Test_AssetAdministrationShell" ))
168
- retrieved_aas_parsed = AASClientTest ._parse_object (object = retrieved_aas , encoder = AASToJsonEncoder )
169
- self .aasRepoClient .post_asset_administration_shell (retrieved_aas_parsed )
167
+ self .aasRepoClient .post_asset_administration_shell (retrieved_aas )
170
168
171
169
self ._assert_api_exception (
172
170
lambda : self .aasRepoClient .post_asset_administration_shell ("a" ), 422 ,
173
171
"Object 'a' is not of type AssetAdministrationShell!" )
174
172
self ._assert_api_exception (
175
- lambda : self .aasRepoClient .post_asset_administration_shell (retrieved_aas_parsed ), 409 ,
173
+ lambda : self .aasRepoClient .post_asset_administration_shell (retrieved_aas ), 409 ,
176
174
"AssetAdministrationShell with Identifier "
177
175
"https://acplt.org/Test_AssetAdministrationShell already exists!" )
178
176
@@ -212,15 +210,11 @@ def test_get_delete_and_post_submodel_refs(self):
212
210
aas_identifier = string_to_base64url ("https://acplt.org/Test_AssetAdministrationShell" ))
213
211
# deserialization to model.Modelreference object is not happening
214
212
submodel_reference = submodel_references .result [0 ]
215
- submodel_reference .__class__ = model .ModelReference
216
- submodel_reference_dump = AASToJsonEncoder ._reference_to_json (submodel_reference )
217
- submodel_reference_parsed = json .loads (submodel_reference_dump )
218
- submodel_id = submodel_reference_parsed .get ('value' , None )
219
213
self .aasRepoClient .delete_submodel_reference_by_id_aas_repository (
220
214
aas_identifier = string_to_base64url ("https://acplt.org/Test_AssetAdministrationShell" ),
221
- submodel_identifier = string_to_base64url (submodel_id ))
215
+ submodel_identifier = string_to_base64url (submodel_reference . get_identifier () ))
222
216
self .aasRepoClient .post_submodel_reference_aas_repository (
223
- body = submodel_reference_parsed , aas_identifier = string_to_base64url (
217
+ body = submodel_reference , aas_identifier = string_to_base64url (
224
218
"https://acplt.org/Test_AssetAdministrationShell" ))
225
219
226
220
def test_put_and_get_submodel (self ):
@@ -410,10 +404,8 @@ def test_delete_and_post_submodel_element(self):
410
404
aas_identifier = string_to_base64url ("https://acplt.org/Test_AssetAdministrationShell" ),
411
405
submodel_identifier = string_to_base64url (self .example_submodel .id ),
412
406
id_short_path = "ExampleSubmodelCollection" )
413
- retrieved_submodel_element_parsed = AASClientTest ._parse_object (object = retrieved_submodel_element ,
414
- encoder = AASToJsonEncoder )
415
407
self .aasRepoClient .post_submodel_element_aas_repository (
416
- body = retrieved_submodel_element_parsed , aas_identifier = string_to_base64url (
408
+ body = retrieved_submodel_element , aas_identifier = string_to_base64url (
417
409
"https://acplt.org/Test_AssetAdministrationShell" ), submodel_identifier = string_to_base64url (
418
410
self .example_submodel .id ))
419
411
retrieved_submodel_element_new = self .aasRepoClient .get_submodel_element_by_path_aas_repository (
@@ -445,10 +437,8 @@ def test_delete_and_post_submodel_element_errors(self):
445
437
aas_identifier = string_to_base64url ("https://acplt.org/Test_AssetAdministrationShell" ),
446
438
submodel_identifier = string_to_base64url (self .example_submodel .id ),
447
439
id_short_path = "ExampleSubmodelCollection" )
448
- retrieved_submodel_element_parsed = AASClientTest ._parse_object (object = retrieved_submodel_element ,
449
- encoder = AASToJsonEncoder )
450
440
self .aasRepoClient .post_submodel_element_aas_repository (
451
- body = retrieved_submodel_element_parsed , aas_identifier = string_to_base64url (
441
+ body = retrieved_submodel_element , aas_identifier = string_to_base64url (
452
442
"https://acplt.org/Test_AssetAdministrationShell" ), submodel_identifier = string_to_base64url (
453
443
self .example_submodel .id ))
454
444
@@ -459,7 +449,7 @@ def test_delete_and_post_submodel_element_errors(self):
459
449
self .example_submodel .id )), 422 , "Object 'a' is not of type SubmodelElement!" )
460
450
self ._assert_api_exception (
461
451
lambda : self .aasRepoClient .post_submodel_element_aas_repository (
462
- body = retrieved_submodel_element_parsed , aas_identifier = string_to_base64url (
452
+ body = retrieved_submodel_element , aas_identifier = string_to_base64url (
463
453
"https://acplt.org/Test_AssetAdministrationShell" ), submodel_identifier = string_to_base64url (
464
454
self .example_submodel .id )), 409 ,
465
455
"SubmodelElement with idShort ExampleSubmodelCollection already exists"
@@ -471,10 +461,8 @@ def test_post_and_delete_submodel_element_in_submodel_element(self):
471
461
aas_identifier = string_to_base64url ("https://acplt.org/Test_AssetAdministrationShell" ),
472
462
submodel_identifier = string_to_base64url (self .example_submodel .id ),
473
463
id_short_path = "ExampleSubmodelCollection" )
474
- retrieved_submodel_element_parsed = AASClientTest ._parse_object (object = retrieved_submodel_element ,
475
- encoder = AASToJsonEncoder )
476
464
self .aasRepoClient .post_submodel_element_by_path_aas_repository (
477
- body = retrieved_submodel_element_parsed , aas_identifier = string_to_base64url (
465
+ body = retrieved_submodel_element , aas_identifier = string_to_base64url (
478
466
"https://acplt.org/Test_AssetAdministrationShell" ), submodel_identifier = string_to_base64url (
479
467
self .example_submodel .id ), id_short_path = "ExampleSubmodelCollection" )
480
468
retrieved_submodel_element_new = self .aasRepoClient .get_submodel_element_by_path_aas_repository (
@@ -493,10 +481,8 @@ def test_post_submodel_element_in_submodel_element_errors(self):
493
481
aas_identifier = string_to_base64url ("https://acplt.org/Test_AssetAdministrationShell" ),
494
482
submodel_identifier = string_to_base64url (self .example_submodel .id ),
495
483
id_short_path = "ExampleSubmodelCollection" )
496
- retrieved_submodel_element_parsed = AASClientTest ._parse_object (object = retrieved_submodel_element ,
497
- encoder = AASToJsonEncoder )
498
484
self .aasRepoClient .post_submodel_element_by_path_aas_repository (
499
- body = retrieved_submodel_element_parsed , aas_identifier = string_to_base64url (
485
+ body = retrieved_submodel_element , aas_identifier = string_to_base64url (
500
486
"https://acplt.org/Test_AssetAdministrationShell" ), submodel_identifier = string_to_base64url (
501
487
self .example_submodel .id ), id_short_path = "ExampleSubmodelCollection" )
502
488
self ._assert_api_exception (
0 commit comments