mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 04:04:00 +00:00
No need to specify SI unit names as they can be derived from the unit type
This commit is contained in:
@@ -26,17 +26,15 @@ class TestAssignSceneUnits:
|
||||
unit.get_scene_unit_name("length").should_be_called().will_return("name")
|
||||
unit.get_scene_unit_si_prefix().should_be_called().will_return("prefix")
|
||||
ifc.run(
|
||||
"unit.add_si_unit", unit_type="LENGTHUNIT", name="name", prefix="prefix"
|
||||
"unit.add_si_unit", unit_type="LENGTHUNIT", prefix="prefix"
|
||||
).should_be_called().will_return("lengthunit")
|
||||
|
||||
unit.get_scene_unit_name("area").should_be_called().will_return("name")
|
||||
ifc.run("unit.add_si_unit", unit_type="AREAUNIT", name="name", prefix="prefix").should_be_called().will_return(
|
||||
"areaunit"
|
||||
)
|
||||
ifc.run("unit.add_si_unit", unit_type="AREAUNIT", prefix="prefix").should_be_called().will_return("areaunit")
|
||||
|
||||
unit.get_scene_unit_name("volume").should_be_called().will_return("name")
|
||||
ifc.run(
|
||||
"unit.add_si_unit", unit_type="VOLUMEUNIT", name="name", prefix="prefix"
|
||||
"unit.add_si_unit", unit_type="VOLUMEUNIT", prefix="prefix"
|
||||
).should_be_called().will_return("volumeunit")
|
||||
|
||||
ifc.run("unit.add_conversion_based_unit", name="degree").should_be_called().will_return("planeangleunit")
|
||||
@@ -104,8 +102,7 @@ class TestAddMonetaryUnit:
|
||||
|
||||
class TestAddSIUnit:
|
||||
def test_run(self, ifc, unit):
|
||||
unit.get_si_name_from_unit_type("unit_type").should_be_called().will_return("name")
|
||||
ifc.run("unit.add_si_unit", unit_type="unit_type", name="name").should_be_called().will_return("unit")
|
||||
ifc.run("unit.add_si_unit", unit_type="unit_type").should_be_called().will_return("unit")
|
||||
unit.import_units().should_be_called()
|
||||
assert subject.add_si_unit(ifc, unit, unit_type="unit_type") == "unit"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user