Skip to content

Commit f0bcd93

Browse files
Fix PR comment
1 parent 7536808 commit f0bcd93

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

core/esmf-aspect-meta-model-python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The class contains functions for accessing units of measurement.
8080
from esmf_aspect_meta_model_python.samm_meta_model import SammUnitsGraph
8181

8282
units_graph = SammUnitsGraph()
83-
unit_data = units_graph.get_description("unit:volt")
83+
unit_data = units_graph.get_info("unit:volt")
8484
# {'preferredName': rdflib.term.Literal('volt', lang='en'), 'commonCode': rdflib.term.Literal('VLT'), ... }
8585

8686
units_graph.print_description(unit_data)

core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_meta_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
1+
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH
22
#
33
# See the AUTHORS file(s) distributed with this work for additional
44
# information regarding authorship.
@@ -59,11 +59,11 @@ def _get_nested_data(self, value: str) -> tuple[str, Union[str, Dict]]:
5959
node_value: Union[str, Dict] = value
6060

6161
if node_type != "Unit":
62-
node_value = self.get_description(f"unit:{node_type}")
62+
node_value = self.get_info(f"unit:{node_type}")
6363

6464
return node_type, node_value
6565

66-
def get_description(self, unit: str) -> Dict:
66+
def get_info(self, unit: str) -> Dict:
6767
"""Get a description of the unit."""
6868
unit_data: Dict = {}
6969
query = self.QUERY_TEMPLATE.substitute(unit=unit)

core/esmf-aspect-meta-model-python/tests/unit/test_samm_meta_model.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,26 +90,26 @@ def test_get_nested_data_unit(self, get_file_path_mock, _, get_units_mock):
9090

9191
assert result == ("Unit", "prefix#Unit")
9292

93-
@mock.patch("esmf_aspect_meta_model_python.samm_meta_model.SammUnitsGraph.get_description")
93+
@mock.patch("esmf_aspect_meta_model_python.samm_meta_model.SammUnitsGraph.get_info")
9494
@mock.patch("esmf_aspect_meta_model_python.samm_meta_model.SammUnitsGraph._get_units")
9595
@mock.patch("esmf_aspect_meta_model_python.samm_meta_model.SammUnitsGraph._validate_path")
9696
@mock.patch("esmf_aspect_meta_model_python.samm_meta_model.SammUnitsGraph._get_file_path")
97-
def test_get_nested_data_not_unit(self, get_file_path_mock, _, get_units_mock, get_description_mock):
97+
def test_get_nested_data_not_unit(self, get_file_path_mock, _, get_units_mock, get_info_mock):
9898
get_file_path_mock.return_value = "unit_file_path"
9999
get_units_mock.return_value = "graph"
100-
get_description_mock.return_value = "nested_value"
100+
get_info_mock.return_value = "nested_value"
101101
units_graph = SammUnitsGraph()
102102
result = units_graph._get_nested_data("prefix#unitType")
103103

104104
assert result == ("unitType", "nested_value")
105-
get_description_mock.assert_called_once_with("unit:unitType")
105+
get_info_mock.assert_called_once_with("unit:unitType")
106106

107107
@mock.patch("esmf_aspect_meta_model_python.samm_meta_model.SammUnitsGraph._get_nested_data")
108108
@mock.patch("esmf_aspect_meta_model_python.samm_meta_model.isinstance")
109109
@mock.patch("esmf_aspect_meta_model_python.samm_meta_model.SammUnitsGraph._get_units")
110110
@mock.patch("esmf_aspect_meta_model_python.samm_meta_model.SammUnitsGraph._validate_path")
111111
@mock.patch("esmf_aspect_meta_model_python.samm_meta_model.SammUnitsGraph._get_file_path")
112-
def test_get_description(self, get_file_path_mock, _, get_units_mock, isinstance_mock, get_nested_data_mock):
112+
def test_get_info(self, get_file_path_mock, _, get_units_mock, isinstance_mock, get_nested_data_mock):
113113
get_file_path_mock.return_value = "unit_file_path"
114114
isinstance_mock.side_effect = (False, URIRef, URIRef)
115115
get_nested_data_mock.side_effect = [("type_key", "type_description"), ("sub_unit", "sub_unit_description")]
@@ -126,7 +126,7 @@ def test_get_description(self, get_file_path_mock, _, get_units_mock, isinstance
126126
graph_mock.query.return_value = [row_1_mock, row_2_mock, row_3_mock]
127127
get_units_mock.return_value = graph_mock
128128
units_graph = SammUnitsGraph()
129-
result = units_graph.get_description("unit:unit_name")
129+
result = units_graph.get_info("unit:unit_name")
130130

131131
assert "unitType" in result
132132
assert result["unitType"] == "unit_1"

0 commit comments

Comments
 (0)