Replace all ifcopenshell.api.run with ifcopenshell.api static functions.

This commit is contained in:
Dion Moult
2024-06-28 12:36:31 +10:00
parent b5d613989e
commit 07060fc769
432 changed files with 4633 additions and 4856 deletions
@@ -17,28 +17,28 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import test.bootstrap
import ifcopenshell.api
import ifcopenshell.api.material
class TestAddMaterialSetIFC2X3(test.bootstrap.IFC2X3):
def test_add_layer_set(self):
material = ifcopenshell.api.run("material.add_material_set", self.file, set_type="IfcMaterialLayerSet")
material = ifcopenshell.api.material.add_material_set(self.file, set_type="IfcMaterialLayerSet")
assert material.LayerSetName == "Unnamed"
assert material.is_a("IfcMaterialLayerSet")
def test_add_list(self):
material = ifcopenshell.api.run("material.add_material_set", self.file, set_type="IfcMaterialList")
material = ifcopenshell.api.material.add_material_set(self.file, set_type="IfcMaterialList")
assert material.is_a("IfcMaterialList")
class TestAddMaterialSetIFC4(test.bootstrap.IFC4, TestAddMaterialSetIFC2X3):
# entities added in IFC4
def test_add_profile_set(self):
material = ifcopenshell.api.run("material.add_material_set", self.file, set_type="IfcMaterialProfileSet")
material = ifcopenshell.api.material.add_material_set(self.file, set_type="IfcMaterialProfileSet")
assert material.Name == "Unnamed"
assert material.is_a("IfcMaterialProfileSet")
def test_add_constituent_set(self):
material = ifcopenshell.api.run("material.add_material_set", self.file, set_type="IfcMaterialConstituentSet")
material = ifcopenshell.api.material.add_material_set(self.file, set_type="IfcMaterialConstituentSet")
assert material.Name == "Unnamed"
assert material.is_a("IfcMaterialConstituentSet")