mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
small fixes after d209cc9ff, added a test
This commit is contained in:
@@ -20,6 +20,7 @@ import pytest
|
||||
import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.util.unit as subject
|
||||
from math import pi
|
||||
|
||||
|
||||
class TestCalculateUnitScale(test.bootstrap.IFC4):
|
||||
@@ -30,6 +31,11 @@ class TestCalculateUnitScale(test.bootstrap.IFC4):
|
||||
ifcopenshell.api.run("unit.assign_unit", self.file, units=[length])
|
||||
assert subject.calculate_unit_scale(self.file) == 0.3048 * 0.001
|
||||
|
||||
angle = ifcopenshell.api.run("unit.add_conversion_based_unit", self.file, name="degree")
|
||||
angle.ConversionFactor.UnitComponent.Prefix = "MILLI"
|
||||
ifcopenshell.api.run("unit.assign_unit", self.file, units=[angle])
|
||||
assert subject.calculate_unit_scale(self.file, "PLANEANGLEUNIT") == pi / 180 * 0.001
|
||||
|
||||
|
||||
class TestFormatLength(test.bootstrap.IFC4):
|
||||
def test_run(self):
|
||||
|
||||
Reference in New Issue
Block a user