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:
@@ -18,19 +18,19 @@
|
||||
|
||||
import pytest
|
||||
import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.api.style
|
||||
|
||||
|
||||
class TestRemoveSurfaceStyleIFC2X3(test.bootstrap.IFC2X3):
|
||||
def test_removing_a_shading_style(self):
|
||||
style = self.file.createIfcSurfaceStyleShading(SurfaceColour=self.file.createIfcColourRgb(None, 1, 1, 1))
|
||||
ifcopenshell.api.run("style.remove_surface_style", self.file, style=style)
|
||||
ifcopenshell.api.style.remove_surface_style(self.file, style=style)
|
||||
assert len(list(self.file)) == 0
|
||||
|
||||
def test_removing_a_texture_style(self):
|
||||
texture = self.file.createIfcImageTexture()
|
||||
style = self.file.createIfcSurfaceStyleWithTextures(Textures=[texture])
|
||||
ifcopenshell.api.run("style.remove_surface_style", self.file, style=style)
|
||||
ifcopenshell.api.style.remove_surface_style(self.file, style=style)
|
||||
assert len(list(self.file)) == 0
|
||||
|
||||
def test_removing_a_rendering_style(self):
|
||||
@@ -46,7 +46,7 @@ class TestRemoveSurfaceStyleIFC2X3(test.bootstrap.IFC2X3):
|
||||
# remove entity_instances() without an ID if we create them afresh, but
|
||||
# will segfault if we load them stale.
|
||||
g = ifcopenshell.file.from_string(self.file.wrapped_data.to_string())
|
||||
ifcopenshell.api.run("style.remove_surface_style", g, style=g.by_type("IfcSurfaceStyleRendering")[0])
|
||||
ifcopenshell.api.style.remove_surface_style(g, style=g.by_type("IfcSurfaceStyleRendering")[0])
|
||||
assert len(list(g)) == 0
|
||||
|
||||
|
||||
@@ -56,5 +56,5 @@ class TestRemoveSurfaceStyleIFC4(test.bootstrap.IFC4, TestRemoveSurfaceStyleIFC2
|
||||
texture = self.file.createIfcImageTexture()
|
||||
coordinates = self.file.createIfcTextureCoordinateGenerator(Maps=[texture])
|
||||
style = self.file.createIfcSurfaceStyleWithTextures(Textures=[texture])
|
||||
ifcopenshell.api.run("style.remove_surface_style", self.file, style=style)
|
||||
ifcopenshell.api.style.remove_surface_style(self.file, style=style)
|
||||
assert len(list(self.file)) == 0
|
||||
|
||||
Reference in New Issue
Block a user