aas-http-client 0.3.8__tar.gz → 0.3.9__tar.gz
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.
Potentially problematic release.
This version of aas-http-client might be problematic. Click here for more details.
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/PKG-INFO +1 -1
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client/utilities/model_builder.py +6 -9
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client.egg-info/PKG-INFO +1 -1
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/pyproject.toml +1 -1
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/tests/test_client.py +10 -7
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/tests/test_wrapper.py +6 -5
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/LICENSE +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/README.md +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client/__init__.py +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client/client.py +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client/core/encoder.py +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client/core/version_check.py +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client/demo/demo_process.py +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client/utilities/__init__.py +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client/utilities/sdk_tools.py +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client/wrapper/sdk_wrapper.py +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client.egg-info/SOURCES.txt +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client.egg-info/dependency_links.txt +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client.egg-info/requires.txt +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client.egg-info/top_level.txt +0 -0
- {aas_http_client-0.3.8 → aas_http_client-0.3.9}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aas-http-client
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.9
|
|
4
4
|
Summary: Generic python HTTP client for communication with various types of AAS servers
|
|
5
5
|
Author-email: Daniel Klein <daniel.klein@em.ag>
|
|
6
6
|
License: # :em engineering methods AG Software License
|
|
@@ -39,17 +39,15 @@ def create_base_submodel_element_property(
|
|
|
39
39
|
return sme
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def create_base_submodel(
|
|
42
|
+
def create_base_submodel(identifier: str, id_short: str, display_name: str = "", description: str = "") -> model.Submodel:
|
|
43
43
|
"""Create a basic Submodel.
|
|
44
44
|
|
|
45
|
+
:param identifier: identifier of the Submodel
|
|
45
46
|
:param id_short: ID short of the Submodel
|
|
46
|
-
:param namespace: namespace of the Submodel , defaults to "fluid40"
|
|
47
47
|
:param display_name: display name of the Submodel, defaults to ""
|
|
48
48
|
:param description: description of the Submodel, defaults to ""
|
|
49
49
|
:return: Submodel instance
|
|
50
50
|
"""
|
|
51
|
-
identifier = f"{namespace}/{id_short}" if namespace else id_short
|
|
52
|
-
|
|
53
51
|
sm = model.Submodel(identifier)
|
|
54
52
|
sm.id_short = id_short
|
|
55
53
|
|
|
@@ -68,16 +66,16 @@ def create_base_submodel(id_short: str, namespace: str = "fluid40", display_name
|
|
|
68
66
|
return sm
|
|
69
67
|
|
|
70
68
|
|
|
71
|
-
def create_base_ass(
|
|
69
|
+
def create_base_ass(identifier: str, id_short: str, display_name: str = "", description: str = "") -> model.AssetAdministrationShell:
|
|
72
70
|
"""Create a basic AAS.
|
|
73
71
|
|
|
72
|
+
:param identifier: identifier of the AAS
|
|
74
73
|
:param id_short: ID short of the AAS
|
|
75
|
-
:param namespace: namespace of the AAS, defaults to "basyx_python_aas_server"
|
|
76
74
|
:param display_name: display name of the AAS, defaults to ""
|
|
77
75
|
:param description: description of the AAS, defaults to ""
|
|
78
76
|
:return: AssetAdministrationShell instance
|
|
79
77
|
"""
|
|
80
|
-
asset_info = create_base_asset_information(
|
|
78
|
+
asset_info = create_base_asset_information(identifier)
|
|
81
79
|
|
|
82
80
|
aas = model.AssetAdministrationShell(id_=asset_info.global_asset_id, asset_information=asset_info)
|
|
83
81
|
aas.id_short = id_short
|
|
@@ -97,14 +95,13 @@ def create_base_ass(id_short: str, namespace: str = "fluid40", display_name: str
|
|
|
97
95
|
return aas
|
|
98
96
|
|
|
99
97
|
|
|
100
|
-
def create_base_asset_information(
|
|
98
|
+
def create_base_asset_information(identifier: str) -> model.AssetInformation:
|
|
101
99
|
"""Return a basic AssetInformation instance.
|
|
102
100
|
|
|
103
101
|
:param id_short: short ID of the AssetInformation
|
|
104
102
|
:param namespace: namespace of the AssetInformation, defaults to "basyx_python_aas_server"
|
|
105
103
|
:return: AssetInformation instance
|
|
106
104
|
"""
|
|
107
|
-
identifier = f"{namespace}/{id_short}" if namespace else id_short
|
|
108
105
|
return model.AssetInformation(model.AssetKind.INSTANCE, identifier)
|
|
109
106
|
|
|
110
107
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aas-http-client
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.9
|
|
4
4
|
Summary: Generic python HTTP client for communication with various types of AAS servers
|
|
5
5
|
Author-email: Daniel Klein <daniel.klein@em.ag>
|
|
6
6
|
License: # :em engineering methods AG Software License
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "aas-http-client"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.9"
|
|
8
8
|
description = "Generic python HTTP client for communication with various types of AAS servers"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { file = "LICENSE" }
|
|
@@ -62,12 +62,12 @@ def shared_sme_float() -> model.Property:
|
|
|
62
62
|
@pytest.fixture(scope="module")
|
|
63
63
|
def shared_sm() -> model.Submodel:
|
|
64
64
|
# create a Submodel
|
|
65
|
-
return model_builder.create_base_submodel("sm_http_client_unit_tests", "")
|
|
65
|
+
return model_builder.create_base_submodel(identifier="fluid40/sm_http_client_unit_tests", id_short="sm_http_client_unit_tests")
|
|
66
66
|
|
|
67
67
|
@pytest.fixture(scope="module")
|
|
68
68
|
def shared_aas(shared_sm: model.Submodel) -> model.AssetAdministrationShell:
|
|
69
69
|
# create an AAS
|
|
70
|
-
aas = model_builder.create_base_ass(
|
|
70
|
+
aas = model_builder.create_base_ass(identifier="fluid40/aas_http_client_unit_tests", id_short="aas_http_client_unit_tests")
|
|
71
71
|
|
|
72
72
|
# add Submodel to AAS
|
|
73
73
|
sdk_tools.add_submodel_to_aas(aas, shared_sm)
|
|
@@ -134,20 +134,22 @@ def test_003_post_asset_administration_shell(client: AasHttpClient, shared_aas:
|
|
|
134
134
|
result = client.post_asset_administration_shell(aas_data)
|
|
135
135
|
|
|
136
136
|
assert result is not None
|
|
137
|
-
|
|
138
|
-
assert
|
|
137
|
+
assert result.get("idShort", "") == shared_aas.id_short
|
|
138
|
+
assert result.get("id", "") == shared_aas.id
|
|
139
139
|
|
|
140
140
|
get_result = client.get_all_asset_administration_shells()
|
|
141
141
|
assert get_result is not None
|
|
142
142
|
shells = get_result.get("result", [])
|
|
143
143
|
assert len(shells) == 1
|
|
144
144
|
assert shells[0].get("idShort", "") == shared_aas.id_short
|
|
145
|
+
assert shells[0].get("id", "") == shared_aas.id
|
|
145
146
|
|
|
146
147
|
def test_004a_get_asset_administration_shell_by_id(client: AasHttpClient, shared_aas: model.AssetAdministrationShell):
|
|
147
148
|
result = client.get_asset_administration_shell_by_id(shared_aas.id)
|
|
148
149
|
|
|
149
150
|
assert result is not None
|
|
150
151
|
assert result.get("idShort", "") == shared_aas.id_short
|
|
152
|
+
assert result.get("id", "") == shared_aas.id
|
|
151
153
|
|
|
152
154
|
def test_004b_get_asset_administration_shell_by_id(client: AasHttpClient):
|
|
153
155
|
result = client.get_asset_administration_shell_by_id("non_existent_id")
|
|
@@ -192,7 +194,8 @@ def test_005a_put_asset_administration_shell_by_id(client: AasHttpClient, shared
|
|
|
192
194
|
def test_005b_put_asset_administration_shell_by_id(client: AasHttpClient, shared_aas: model.AssetAdministrationShell):
|
|
193
195
|
# put with other ID
|
|
194
196
|
id_short = "put_short_id"
|
|
195
|
-
|
|
197
|
+
identifier = f"fluid40/{id_short}"
|
|
198
|
+
asset_info = model_builder.create_base_asset_information(identifier)
|
|
196
199
|
aas = model.AssetAdministrationShell(id_=asset_info.global_asset_id, asset_information=asset_info)
|
|
197
200
|
aas.id_short = id_short
|
|
198
201
|
|
|
@@ -310,7 +313,7 @@ def test_012_patch_submodel_by_id(client: AasHttpClient, shared_sm: model.Submod
|
|
|
310
313
|
assert get_result.get("displayName", {})[0].get("text", "") == shared_sm.display_name.get("en", "")
|
|
311
314
|
|
|
312
315
|
def test_013_put_submodel_by_id_aas_repository(client: AasHttpClient, shared_aas: model.AssetAdministrationShell, shared_sm: model.Submodel):
|
|
313
|
-
sm = model.Submodel(shared_sm.
|
|
316
|
+
sm = model.Submodel(shared_sm.id)
|
|
314
317
|
sm.id_short = shared_sm.id_short
|
|
315
318
|
|
|
316
319
|
description_text = "Put via shell description for unit tests"
|
|
@@ -343,7 +346,7 @@ def test_013_put_submodel_by_id_aas_repository(client: AasHttpClient, shared_aas
|
|
|
343
346
|
client.put_submodel_by_id_aas_repository(shared_aas.id, shared_sm.id, sm_data) # Restore original submodel
|
|
344
347
|
|
|
345
348
|
def test_014_put_submodels_by_id(client: AasHttpClient, shared_sm: model.Submodel):
|
|
346
|
-
sm = model.Submodel(shared_sm.
|
|
349
|
+
sm = model.Submodel(shared_sm.id)
|
|
347
350
|
sm.id_short = shared_sm.id_short
|
|
348
351
|
|
|
349
352
|
description_text = "Put description for unit tests"
|
|
@@ -62,14 +62,14 @@ def shared_sme_float() -> model.Property:
|
|
|
62
62
|
@pytest.fixture(scope="module")
|
|
63
63
|
def shared_sm() -> model.Submodel:
|
|
64
64
|
# create a Submodel
|
|
65
|
-
submodel = model_builder.create_base_submodel("sm_http_client_unit_tests", "")
|
|
65
|
+
submodel = model_builder.create_base_submodel(identifier="fluid40/sm_http_client_unit_tests", id_short="sm_http_client_unit_tests")
|
|
66
66
|
submodel.category = "Unit Test"
|
|
67
67
|
return submodel
|
|
68
68
|
|
|
69
69
|
@pytest.fixture(scope="module")
|
|
70
70
|
def shared_aas(shared_sm: model.Submodel) -> model.AssetAdministrationShell:
|
|
71
71
|
# create an AAS
|
|
72
|
-
aas = model_builder.create_base_ass(
|
|
72
|
+
aas = model_builder.create_base_ass(identifier="fluid40/aas_http_client_unit_tests", id_short="aas_http_client_unit_tests")
|
|
73
73
|
|
|
74
74
|
# add Submodel to AAS
|
|
75
75
|
sdk_tools.add_submodel_to_aas(aas, shared_sm)
|
|
@@ -163,7 +163,8 @@ def test_005a_put_asset_administration_shell_by_id(wrapper: SdkWrapper, shared_a
|
|
|
163
163
|
def test_005b_put_asset_administration_shell_by_id(wrapper: SdkWrapper, shared_aas: model.AssetAdministrationShell):
|
|
164
164
|
# put with other ID
|
|
165
165
|
id_short = "put_short_id"
|
|
166
|
-
|
|
166
|
+
identifier = f"fluid40/{id_short}"
|
|
167
|
+
asset_info = model_builder.create_base_asset_information(identifier)
|
|
167
168
|
aas = model.AssetAdministrationShell(id_=asset_info.global_asset_id, asset_information=asset_info)
|
|
168
169
|
aas.id_short = id_short
|
|
169
170
|
|
|
@@ -268,7 +269,7 @@ def test_012_patch_submodel_by_id(wrapper: SdkWrapper, shared_sm: model.Submodel
|
|
|
268
269
|
assert len(submodel.submodel_element) == len(shared_sm.submodel_element)
|
|
269
270
|
|
|
270
271
|
def test_013_put_submodel_by_id_aas_repository(wrapper: SdkWrapper, shared_aas: model.AssetAdministrationShell, shared_sm: model.Submodel):
|
|
271
|
-
sm = model.Submodel(shared_sm.
|
|
272
|
+
sm = model.Submodel(shared_sm.id)
|
|
272
273
|
sm.id_short = shared_sm.id_short
|
|
273
274
|
|
|
274
275
|
description_text = "Put via shell description for unit tests"
|
|
@@ -301,7 +302,7 @@ def test_013_put_submodel_by_id_aas_repository(wrapper: SdkWrapper, shared_aas:
|
|
|
301
302
|
wrapper.put_submodel_by_id_aas_repository(shared_aas.id, shared_sm.id, shared_sm) # Restore original submodel
|
|
302
303
|
|
|
303
304
|
def test_014_put_submodels_by_id(wrapper: SdkWrapper, shared_sm: model.Submodel):
|
|
304
|
-
sm = model.Submodel(shared_sm.
|
|
305
|
+
sm = model.Submodel(shared_sm.id)
|
|
305
306
|
sm.id_short = shared_sm.id_short
|
|
306
307
|
|
|
307
308
|
description_text = "Put description for unit tests"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aas_http_client-0.3.8 → aas_http_client-0.3.9}/aas_http_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|