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") unit.import_units().should_be_called() assert subject.add_si_unit(ifc, unit, unit_type="unit_type") == "unit"
def test_run(self, ifc, unit): ifc.run("unit.add_context_dependent_unit", unit_type="unit_type", name="name").should_be_called().will_return("unit") unit.import_units().should_be_called() assert subject.add_context_dependent_unit(ifc, unit, unit_type="unit_type", name="name") == "unit"
def test_editing_named_units(self, ifc, unit): unit.export_unit_attributes().should_be_called().will_return( "attributes") unit.get_unit_class("unit").should_be_called().will_return( "IfcNamedUnit") ifc.run("unit.edit_named_unit", unit="unit", attributes="attributes").should_be_called() unit.import_units().should_be_called() unit.clear_active_unit().should_be_called() subject.edit_unit(ifc, unit, unit="unit")
def test_run(self, unit): unit.import_units().should_be_called() unit.enable_editing_units().should_be_called() subject.load_units(unit)
def test_run(self, ifc, unit): ifc.run("unit.unassign_unit", units=["unit"]).should_be_called() unit.import_units().should_be_called() subject.unassign_unit(ifc, unit, unit="unit")
def test_run(self, ifc, unit): ifc.run("unit.add_monetary_unit").should_be_called().will_return( "unit") unit.import_units().should_be_called() assert subject.add_monetary_unit(ifc, unit) == "unit"
def test_run(self, ifc, unit): ifc.run("unit.remove_unit", unit="unit").should_be_called() unit.import_units().should_be_called() subject.remove_unit(ifc, unit, unit="unit")