mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
ifc2x3 tests
This commit is contained in:
@@ -21,7 +21,7 @@ import test.bootstrap
|
||||
import ifcopenshell.api
|
||||
|
||||
|
||||
class TestRemoveSurfaceStyle(test.bootstrap.IFC4):
|
||||
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)
|
||||
@@ -33,13 +33,6 @@ class TestRemoveSurfaceStyle(test.bootstrap.IFC4):
|
||||
ifcopenshell.api.run("style.remove_surface_style", self.file, style=style)
|
||||
assert len(list(self.file)) == 0
|
||||
|
||||
def test_removing_a_texture_style_with_all_of_its_coordinates(self):
|
||||
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)
|
||||
assert len(list(self.file)) == 0
|
||||
|
||||
def test_removing_a_rendering_style(self):
|
||||
style = self.file.createIfcSurfaceStyleRendering(
|
||||
SurfaceColour=self.file.createIfcColourRgb(None, 1, 1, 1),
|
||||
@@ -55,3 +48,13 @@ class TestRemoveSurfaceStyle(test.bootstrap.IFC4):
|
||||
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])
|
||||
assert len(list(g)) == 0
|
||||
|
||||
|
||||
class TestRemoveSurfaceStyleIFC4(test.bootstrap.IFC4, TestRemoveSurfaceStyleIFC2X3):
|
||||
# IfcTextureCoordinateGenerator doesn't have Maps in IFC2X3
|
||||
def test_removing_a_texture_style_with_all_of_its_coordinates(self):
|
||||
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)
|
||||
assert len(list(self.file)) == 0
|
||||
|
||||
Reference in New Issue
Block a user