diff --git a/src/ifc5d/ifc5d/qto.py b/src/ifc5d/ifc5d/qto.py index 14088ed86e..8beabe02f4 100644 --- a/src/ifc5d/ifc5d/qto.py +++ b/src/ifc5d/ifc5d/qto.py @@ -76,7 +76,7 @@ class SI2ProjectUnitConverter: "IfcLengthMeasure": "METRE", "IfcMassMeasure": "GRAM", "IfcTimeMeasure": "SECOND", - "IfcVolumeMeasure": "CUBIE_METRE", + "IfcVolumeMeasure": "CUBIC_METRE", } def convert(self, value, measure): diff --git a/src/ifcopenshell-python/test/util/test_unit.py b/src/ifcopenshell-python/test/util/test_unit.py index 52a6a93178..0852019976 100644 --- a/src/ifcopenshell-python/test/util/test_unit.py +++ b/src/ifcopenshell-python/test/util/test_unit.py @@ -16,13 +16,22 @@ # You should have received a copy of the GNU Lesser General Public License # along with IfcOpenShell. If not, see . -import pytest import test.bootstrap import ifcopenshell.api import ifcopenshell.util.unit as subject from math import pi +class TestConvert(test.bootstrap.IFC4): + def test_run(self): + assert subject.convert(1, None, "METRE", None, "METRE") == 1 + assert subject.convert(1, None, "METRE", "MILLI", "METRE") == 1000 + assert subject.convert(1000, "MILLI", "METRE", None, "METRE") == 1 + assert subject.convert(1, None, "SQUARE_METRE", None, "SQUARE_METRE") == 1 + assert subject.convert(1, None, "SQUARE_METRE", "MILLI", "SQUARE_METRE") == 1000000 + assert subject.convert(1, None, "CUBIC_METRE", "MILLI", "CUBIC_METRE") == 1000000000 + + class TestCalculateUnitScale(test.bootstrap.IFC4): def test_prefix_and_conversion_based_units_are_considered(self): ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcProject")