Fixing tests after 2dc9dc200

This commit is contained in:
Andrej730
2023-06-27 15:04:35 +05:00
parent 3aff29dec1
commit 7e2b40176c
6 changed files with 69 additions and 16 deletions
+23 -6
View File
@@ -85,22 +85,39 @@ class TestUpdateStyleColours:
def test_updating_rendering_style_if_available(self, ifc, style):
style.get_style("obj").should_be_called().will_return("element")
style.can_support_rendering_style("obj").should_be_called().will_return(True)
style.get_surface_rendering_style("obj").should_be_called().will_return("style")
style.get_surface_rendering_attributes("obj").should_be_called().will_return("attributes")
ifc.run("style.edit_surface_style", style="style", attributes="attributes").should_be_called()
style.get_surface_rendering_style("obj").should_be_called().will_return("rendering_style")
style.get_texture_style("obj").should_be_called().will_return("texture_style")
style.get_surface_rendering_attributes("obj", "verbose").should_be_called().will_return("attributes")
ifc.run("style.edit_surface_style", style="rendering_style", attributes="attributes").should_be_called()
ifc.run("style.add_surface_textures", material="obj").should_be_called().will_return("textures")
ifc.run("style.edit_surface_style", style="texture_style", attributes={"Textures": "textures"}).should_be_called().will_return("textures")
style.record_shading("obj").should_be_called()
subject.update_style_colours(ifc, style, obj="obj")
subject.update_style_colours(ifc, style, obj="obj", verbose="verbose")
def test_adding_a_rendering_style_if_not_available(self, ifc, style):
style.get_style("obj").should_be_called().will_return("element")
style.can_support_rendering_style("obj").should_be_called().will_return(True)
style.get_surface_rendering_style("obj").should_be_called().will_return(None)
style.get_surface_rendering_attributes("obj").should_be_called().will_return("attributes")
style.get_texture_style("obj").should_be_called().will_return(None)
style.get_surface_rendering_attributes("obj", "verbose").should_be_called().will_return("attributes")
ifc.run(
"style.add_surface_style", style="element", ifc_class="IfcSurfaceStyleRendering", attributes="attributes"
).should_be_called()
ifc.run("style.add_surface_textures", material="obj").should_be_called().will_return("textures")
ifc.run(
"style.add_surface_style",
style="element",
ifc_class="IfcSurfaceStyleWithTextures",
attributes={"Textures": "textures"},
).should_be_called()
style.record_shading("obj").should_be_called()
subject.update_style_colours(ifc, style, obj="obj")
subject.update_style_colours(ifc, style, obj="obj", verbose="verbose")
def test_updating_shading_style_as_a_fallback_if_available(self, ifc, style):
style.get_style("obj").should_be_called().will_return("element")