No need to specify SI unit names as they can be derived from the unit type

This commit is contained in:
Dion Moult
2023-01-05 17:16:46 +11:00
parent 70b7f1424f
commit cb92be2b08
4 changed files with 8 additions and 21 deletions
+4 -7
View File
@@ -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"