mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
Replace all ifcopenshell.api.run with ifcopenshell.api static functions.
This commit is contained in:
@@ -16,15 +16,13 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import numpy
|
||||
import pytest
|
||||
import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.api.structural
|
||||
|
||||
|
||||
class TestAddStructuralAnalysisModel(test.bootstrap.IFC4):
|
||||
def test_adding_a_structural_analysis_model(self):
|
||||
subject = ifcopenshell.api.run("structural.add_structural_analysis_model", self.file)
|
||||
subject = ifcopenshell.api.structural.add_structural_analysis_model(self.file)
|
||||
models = self.file.by_type("IfcStructuralAnalysisModel")
|
||||
assert subject == models[0]
|
||||
assert subject.is_a("IfcStructuralAnalysisModel")
|
||||
|
||||
+6
-8
@@ -16,20 +16,18 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import numpy
|
||||
import pytest
|
||||
import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.api.root
|
||||
import ifcopenshell.api.structural
|
||||
|
||||
|
||||
class TestAssignStructuralAnalysisModel(test.bootstrap.IFC4):
|
||||
def test_assigning_a_structural_analysis_model(self):
|
||||
subject = ifcopenshell.api.run("structural.add_structural_analysis_model", self.file)
|
||||
product = ifcopenshell.api.run(
|
||||
"root.create_entity", self.file, ifc_class="IfcStructuralMember", predefined_type=None, name=None
|
||||
subject = ifcopenshell.api.structural.add_structural_analysis_model(self.file)
|
||||
product = ifcopenshell.api.root.create_entity(
|
||||
self.file, ifc_class="IfcStructuralMember", predefined_type=None, name=None
|
||||
)
|
||||
rel = ifcopenshell.api.run(
|
||||
"structural.assign_structural_analysis_model",
|
||||
rel = ifcopenshell.api.structural.assign_structural_analysis_model(
|
||||
self.file,
|
||||
product=product,
|
||||
structural_analysis_model=subject,
|
||||
|
||||
@@ -16,17 +16,14 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import numpy
|
||||
import pytest
|
||||
import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.api.structural
|
||||
|
||||
|
||||
class TestEditStructuralAnalysisModel(test.bootstrap.IFC4):
|
||||
def test_editing_a_structural_analysis_model(self):
|
||||
subject = ifcopenshell.api.run("structural.add_structural_analysis_model", self.file)
|
||||
subject = ifcopenshell.api.run(
|
||||
"structural.edit_structural_analysis_model",
|
||||
subject = ifcopenshell.api.structural.add_structural_analysis_model(self.file)
|
||||
subject = ifcopenshell.api.structural.edit_structural_analysis_model(
|
||||
self.file,
|
||||
structural_analysis_model=subject,
|
||||
attributes={"Name": "My edited model", "Description": "Description of my model"},
|
||||
|
||||
+3
-6
@@ -16,17 +16,14 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import numpy
|
||||
import pytest
|
||||
import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.api.structural
|
||||
|
||||
|
||||
class TestRemoveStructuralAnalysisModel(test.bootstrap.IFC4):
|
||||
def test_removing_a_structural_analysis_model(self):
|
||||
subject = ifcopenshell.api.run("structural.add_structural_analysis_model", self.file)
|
||||
ifcopenshell.api.run(
|
||||
"structural.remove_structural_analysis_model",
|
||||
subject = ifcopenshell.api.structural.add_structural_analysis_model(self.file)
|
||||
ifcopenshell.api.structural.remove_structural_analysis_model(
|
||||
self.file,
|
||||
structural_analysis_model=subject,
|
||||
)
|
||||
|
||||
+7
-10
@@ -16,26 +16,23 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import numpy
|
||||
import pytest
|
||||
import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.api.root
|
||||
import ifcopenshell.api.structural
|
||||
|
||||
|
||||
class TestUnassignStructuralAnalysisModel(test.bootstrap.IFC4):
|
||||
def test_unassigning_a_structural_analysis_model(self):
|
||||
subject = ifcopenshell.api.run("structural.add_structural_analysis_model", self.file)
|
||||
product = ifcopenshell.api.run(
|
||||
"root.create_entity", self.file, ifc_class="IfcStructuralMember", predefined_type=None, name=None
|
||||
subject = ifcopenshell.api.structural.add_structural_analysis_model(self.file)
|
||||
product = ifcopenshell.api.root.create_entity(
|
||||
self.file, ifc_class="IfcStructuralMember", predefined_type=None, name=None
|
||||
)
|
||||
rel = ifcopenshell.api.run(
|
||||
"structural.assign_structural_analysis_model",
|
||||
ifcopenshell.api.structural.assign_structural_analysis_model(
|
||||
self.file,
|
||||
product=product,
|
||||
structural_analysis_model=subject,
|
||||
)
|
||||
ifcopenshell.api.run(
|
||||
"structural.unassign_structural_analysis_model",
|
||||
ifcopenshell.api.structural.unassign_structural_analysis_model(
|
||||
self.file,
|
||||
product=product,
|
||||
structural_analysis_model=subject,
|
||||
|
||||
Reference in New Issue
Block a user