Fix buildvolume tests

This commit is contained in:
Jaime van Kessel 2022-07-08 10:19:09 +02:00
parent e73a18afc1
commit 1f1ee7ff60

View file

@ -146,7 +146,7 @@ class TestComputeDisallowedAreasStatic:
build_volume._global_container_stack = mocked_stack
with patch("cura.Settings.ExtruderManager.ExtruderManager.getInstance"):
result = build_volume._computeDisallowedAreasStatic(0, [mocked_extruder])
assert result == {"zomg": [Polygon([[-84.0, 102.5], [-115.0, 102.5], [-200.0, 112.5], [-82.0, 112.5]])]}
assert result == {"zomg": [Polygon([[-84.0,102.5], [-115.0,102.5], [-200.0,112.5], [-82.0,112.5]]), Polygon([[-100.0,-100.0], [-100.0,100.0], [-99.9,99.9], [-99.9,-99.9]]), Polygon([[100.0,100.0], [100.0,-100.0], [99.9,-99.9], [99.9,99.9]]), Polygon([[-100.0,100.0], [100.0,100.0], [99.9,99.9], [-99.9,99.9]]), Polygon([[100.0,-100.0], [-100.0,-100.0], [-99.9,-99.9], [99.9,-99.9]])]}
def test_computeDisalowedAreasMutliExtruder(self, build_volume):
mocked_stack = MagicMock()
@ -160,7 +160,12 @@ class TestComputeDisallowedAreasStatic:
build_volume._global_container_stack = mocked_stack
with patch("cura.Settings.ExtruderManager.ExtruderManager.getInstance", MagicMock(return_value = extruder_manager)):
result = build_volume._computeDisallowedAreasStatic(0, [mocked_extruder])
assert result == {"zomg": [Polygon([[-84.0, 102.5], [-115.0, 102.5], [-200.0, 112.5], [-82.0, 112.5]])]}
assert result == {"zomg": [Polygon([[-84.0, 102.5], [-115.0, 102.5], [-200.0, 112.5], [-82.0, 112.5]]),
Polygon([[-100.0, -100.0], [-100.0, 100.0], [-99.9, 99.9], [-99.9, -99.9]]),
Polygon([[100.0, 100.0], [100.0, -100.0], [99.9, -99.9], [99.9, 99.9]]),
Polygon([[-100.0, 100.0], [100.0, 100.0], [99.9, 99.9], [-99.9, 99.9]]),
Polygon([[100.0, -100.0], [-100.0, -100.0], [-99.9, -99.9], [99.9, -99.9]])]}
class TestUpdateRaftThickness:
setting_property_dict = {"raft_base_thickness": {"value": 1},