Skip to content

Commit

Permalink
test: enable repaire and prepare tools testing
Browse files Browse the repository at this point in the history
  • Loading branch information
RobPasMue committed Dec 10, 2024
1 parent 56bb163 commit 8772fa4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 49 deletions.
7 changes: 0 additions & 7 deletions tests/integration/test_prepare_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@

def test_volume_extract_from_faces(modeler: Modeler):
"""Test a volume is created from the provided faces."""
skip_if_linux(
modeler, test_volume_extract_from_faces.__name__, "prepare_tools"
) # Skip test on Linux
design = modeler.open_file(FILES_DIR / "hollowCylinder.scdocx")

body = design.bodies[0]
Expand All @@ -43,9 +40,6 @@ def test_volume_extract_from_faces(modeler: Modeler):

def test_volume_extract_from_edge_loops(modeler: Modeler):
"""Test a volume is created from the provided edges."""
skip_if_linux(
modeler, test_volume_extract_from_edge_loops.__name__, "prepare_tools"
) # Skip test on Linux
design = modeler.open_file(FILES_DIR / "hollowCylinder.scdocx")

body = design.bodies[0]
Expand All @@ -59,7 +53,6 @@ def test_volume_extract_from_edge_loops(modeler: Modeler):

def test_share_topology(modeler: Modeler):
"""Test share topology operation is between two bodies."""
skip_if_linux(modeler, test_share_topology.__name__, "prepare_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "MixingTank.scdocx")

assert modeler.prepare_tools.share_topology(design.bodies)
42 changes: 0 additions & 42 deletions tests/integration/test_repair_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,41 +30,34 @@

def test_find_split_edges(modeler: Modeler):
"""Test if split edge problem areas are detectable."""
skip_if_linux(modeler, test_find_split_edges.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "SplitEdgeDesignTest.scdocx")
problem_areas = modeler.repair_tools.find_split_edges(design.bodies, 25, 150)
assert len(problem_areas) == 3


def test_find_split_edge_id(modeler: Modeler):
"""Test whether problem area has the id."""
skip_if_linux(modeler, test_find_split_edge_id.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "SplitEdgeDesignTest.scdocx")
problem_areas = modeler.repair_tools.find_split_edges(design.bodies, 25, 150)
assert problem_areas[0].id != "0"


def test_find_split_edge_edges(modeler: Modeler):
"""Test to find split edge problem areas with the connected edges."""
skip_if_linux(
modeler, test_find_split_edge_edges.__name__, "repair_tools"
) # Skip test on Linux
design = modeler.open_file(FILES_DIR / "SplitEdgeDesignTest.scdocx")
problem_areas = modeler.repair_tools.find_split_edges(design.bodies, 25, 150)
assert len(problem_areas[0].edges) > 0


def test_fix_split_edge(modeler: Modeler):
"""Test to find and fix split edge problem areas."""
skip_if_linux(modeler, test_fix_split_edge.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "SplitEdgeDesignTest.scdocx")
problem_areas = modeler.repair_tools.find_split_edges(design.bodies, 25, 150)
assert problem_areas[0].fix().success is True


def test_find_extra_edges(modeler: Modeler):
"""Test to read geometry and find it's extra edge problem areas."""
skip_if_linux(modeler, test_find_extra_edges.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "ExtraEdgesDesignBefore.scdocx")

problem_areas = modeler.repair_tools.find_extra_edges(design.bodies)
Expand All @@ -73,7 +66,6 @@ def test_find_extra_edges(modeler: Modeler):

def test_find_extra_edge_id(modeler: Modeler):
"""Test whether problem area has the id."""
skip_if_linux(modeler, test_find_extra_edge_id.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "ExtraEdgesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_extra_edges(design.bodies)
assert problem_areas[0].id != "0"
Expand All @@ -83,9 +75,6 @@ def test_find_extra_edge_edges(modeler: Modeler):
"""Test to read geometry and find it's extra edge problem area with
connected edges.
"""
skip_if_linux(
modeler, test_find_extra_edge_edges.__name__, "repair_tools"
) # Skip test on Linux
design = modeler.open_file(FILES_DIR / "ExtraEdgesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_extra_edges(design.bodies)
assert len(problem_areas[0].edges) > 0
Expand All @@ -94,23 +83,20 @@ def test_find_extra_edge_edges(modeler: Modeler):
@pytest.mark.skip(reason="This test is failing on the Geometry Service - issue 1335")
def test_fix_extra_edge(modeler: Modeler):
"""Test to find and fix extra edge problem areas."""
skip_if_linux(modeler, test_fix_extra_edge.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "ExtraEdgesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_extra_edges(design.bodies)
assert problem_areas[0].fix().success is True


def test_find_inexact_edges(modeler: Modeler):
"""Test to read geometry and find it's inexact edge problem areas."""
skip_if_linux(modeler, test_find_inexact_edges.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "InExactEdgesBefore.scdocx")
problem_areas = modeler.repair_tools.find_inexact_edges(design.bodies)
assert len(problem_areas) == 12


def test_find_inexact_edge_id(modeler: Modeler):
"""Test whether problem area has the id."""
skip_if_linux(modeler, test_find_inexact_edge_id.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "InExactEdgesBefore.scdocx")
problem_areas = modeler.repair_tools.find_inexact_edges(design.bodies)
assert problem_areas[0].id != "0"
Expand All @@ -120,9 +106,6 @@ def test_find_inexact_edge_edges(modeler: Modeler):
"""Test to read geometry and find it's inexact edge problem areas with
connected edges.
"""
skip_if_linux(
modeler, test_find_inexact_edge_edges.__name__, "repair_tools"
) # Skip test on Linux
design = modeler.open_file(FILES_DIR / "InExactEdgesBefore.scdocx")
problem_areas = modeler.repair_tools.find_inexact_edges(design.bodies)
assert len(problem_areas[0].edges) > 0
Expand All @@ -132,23 +115,20 @@ def test_fix_inexact_edge(modeler: Modeler):
"""Test to read geometry and find and fix it's inexact edge problem
areas.
"""
skip_if_linux(modeler, test_fix_inexact_edge.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "InExactEdgesBefore.scdocx")
problem_areas = modeler.repair_tools.find_inexact_edges(design.bodies)
assert problem_areas[0].fix().success is True


def test_find_missing_faces(modeler: Modeler):
"""Test to read geometry and find it's missing face problem areas."""
skip_if_linux(modeler, test_find_missing_faces.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "MissingFacesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_missing_faces(design.bodies)
assert len(problem_areas) == 1


def test_find_missing_face_id(modeler: Modeler):
"""Test whether problem area has the id."""
skip_if_linux(modeler, test_find_missing_face_id.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "MissingFacesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_missing_faces(design.bodies)
assert problem_areas[0].id != "0"
Expand All @@ -158,9 +138,6 @@ def test_find_missing_face_faces(modeler: Modeler):
"""Test to read geometry and find it's missing face problem area with
connected edges.
"""
skip_if_linux(
modeler, test_find_missing_face_faces.__name__, "repair_tools"
) # Skip test on Linux
design = modeler.open_file(FILES_DIR / "MissingFacesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_missing_faces(design.bodies)
assert len(problem_areas[0].edges) > 0
Expand All @@ -170,23 +147,20 @@ def test_fix_missing_face(modeler: Modeler):
"""Test to read geometry and find and fix it's missing face problem
areas.
"""
skip_if_linux(modeler, test_fix_missing_face.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "MissingFacesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_missing_faces(design.bodies)
assert problem_areas[0].fix().success is True


def test_find_duplicate_faces(modeler: Modeler):
"""Test to read geometry and find it's duplicate face problem areas."""
skip_if_linux(modeler, test_find_duplicate_faces.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "DuplicateFacesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_duplicate_faces(design.bodies)
assert len(problem_areas) == 1


def test_duplicate_face_id(modeler: Modeler):
"""Test whether duplicate face problem area has the id."""
skip_if_linux(modeler, test_duplicate_face_id.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "DuplicateFacesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_duplicate_faces(design.bodies)
assert problem_areas[0].id != "0"
Expand All @@ -196,7 +170,6 @@ def test_duplicate_face_faces(modeler: Modeler):
"""Test to read geometry and find it's duplicate face problem area and its
connected faces.
"""
skip_if_linux(modeler, test_duplicate_face_faces.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "DuplicateFacesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_duplicate_faces(design.bodies)
assert len(problem_areas[0].faces) > 0
Expand All @@ -206,23 +179,20 @@ def test_fix_duplicate_face(modeler: Modeler):
"""Test to read geometry and find and fix it's duplicate face problem
areas.
"""
skip_if_linux(modeler, test_fix_duplicate_face.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "DuplicateFacesDesignBefore.scdocx")
problem_areas = modeler.repair_tools.find_duplicate_faces(design.bodies)
assert problem_areas[0].fix().success is True


def test_find_small_faces(modeler: Modeler):
"""Test to read geometry and find it's small face problem areas."""
skip_if_linux(modeler, test_find_small_faces.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "SmallFacesBefore.scdocx")
problem_areas = modeler.repair_tools.find_small_faces(design.bodies)
assert len(problem_areas) == 4


def test_find_small_face_id(modeler: Modeler):
"""Test whether problem area has the id."""
skip_if_linux(modeler, test_find_small_face_id.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "SmallFacesBefore.scdocx")
problem_areas = modeler.repair_tools.find_small_faces(design.bodies)
assert problem_areas[0].id != "0"
Expand All @@ -232,33 +202,27 @@ def test_find_small_face_faces(modeler: Modeler):
"""Test to read geometry, find it's small face problem area and return
connected faces.
"""
skip_if_linux(
modeler, test_find_small_face_faces.__name__, "repair_tools"
) # Skip test on Linux
design = modeler.open_file(FILES_DIR / "SmallFacesBefore.scdocx")
problem_areas = modeler.repair_tools.find_small_faces(design.bodies)
assert len(problem_areas[0].faces) > 0


def test_fix_small_face(modeler: Modeler):
"""Test to read geometry and find and fix it's small face problem areas."""
skip_if_linux(modeler, test_fix_small_face.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "SmallFacesBefore.scdocx")
problem_areas = modeler.repair_tools.find_small_faces(design.bodies)
assert problem_areas[0].fix().success is True


def test_find_stitch_faces(modeler: Modeler):
"""Test to read geometry and find it's stitch face problem areas."""
skip_if_linux(modeler, test_find_stitch_faces.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "stitch_before.scdocx")
problem_areas = modeler.repair_tools.find_stitch_faces(design.bodies)
assert len(problem_areas) == 1


def test_find_stitch_face_id(modeler: Modeler):
"""Test whether problem area has the id."""
skip_if_linux(modeler, test_find_stitch_face_id.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "stitch_before.scdocx")
problem_areas = modeler.repair_tools.find_stitch_faces(design.bodies)
assert problem_areas[0].id != "0"
Expand All @@ -268,9 +232,6 @@ def test_find_stitch_face_bodies(modeler: Modeler):
"""Test to read geometry and find it's stitch face problem area and return
the connected faces.
"""
skip_if_linux(
modeler, test_find_stitch_face_bodies.__name__, "repair_tools"
) # Skip test on Linux
design = modeler.open_file(FILES_DIR / "stitch_before.scdocx")
problem_areas = modeler.repair_tools.find_stitch_faces(design.bodies)
assert len(problem_areas[0].bodies) > 0
Expand All @@ -280,7 +241,6 @@ def test_fix_stitch_face(modeler: Modeler):
"""Test to read geometry, find the split edge problem areas and to fix
them.
"""
skip_if_linux(modeler, test_fix_stitch_face.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "stitch_before.scdocx")
problem_areas = modeler.repair_tools.find_stitch_faces(design.bodies)
message = problem_areas[0].fix()
Expand All @@ -291,15 +251,13 @@ def test_fix_stitch_face(modeler: Modeler):

def test_find_short_edges(modeler: Modeler):
"""Test to read geometry and find it's short edge problem areas."""
skip_if_linux(modeler, test_find_short_edges.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "ShortEdgesBefore.scdocx")
problem_areas = modeler.repair_tools.find_short_edges(design.bodies, 10)
assert len(problem_areas) == 12


def test_fix_short_edges(modeler: Modeler):
"""Test to read geometry and find and fix it's short edge problem areas."""
skip_if_linux(modeler, test_fix_short_edges.__name__, "repair_tools") # Skip test on Linux
design = modeler.open_file(FILES_DIR / "ShortEdgesBefore.scdocx")
problem_areas = modeler.repair_tools.find_short_edges(design.bodies, 10)
assert problem_areas[0].fix().success is True

0 comments on commit 8772fa4

Please sign in to comment.