Skip to content

Commit 285d970

Browse files
committed
test(mesh-filters): keep_largest_component wasi test
1 parent 60f054a commit 285d970

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1-
# Generated file. To retain edits, remove this comment.
1+
from pathlib import Path
2+
3+
from itkwasm_mesh_io import read_mesh
4+
from itkwasm_compare_meshes import compare_meshes
25

36
from itkwasm_mesh_filters_wasi import keep_largest_component
47

5-
from .common import test_input_path, test_output_path
8+
from .common import test_input_path, test_baseline_path
69

710
def test_keep_largest_component():
8-
pass
11+
input_mesh_path = test_input_path / "suzanne.off"
12+
input_mesh = read_mesh(input_mesh_path)
13+
14+
output_mesh = keep_largest_component(input_mesh)
15+
16+
baseline_mesh_path = test_baseline_path / "suzanne-keep-largest-component.iwm.cbor"
17+
baseline_mesh = read_mesh(baseline_mesh_path)
18+
19+
comparison = compare_meshes(output_mesh, baseline_meshes=[baseline_mesh])
20+
21+
assert comparison[0]['almostEqual']
22+

packages/mesh-filters/python/itkwasm-mesh-filters-wasi/tests/test_repair.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
from itkwasm_mesh_filters_wasi import repair
77

8-
9-
from .common import test_input_path, test_baseline_path, test_output_path
8+
from .common import test_input_path, test_baseline_path
109

1110
def test_repair():
1211
input_mesh_path = test_input_path / "suzanne.off"
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Generated file. To retain edits, remove this comment.
22

3-
from itkwasm_mesh_filters_wasi import remesh
3+
from itkwasm_mesh_filters_wasi import smooth_remesh
44

55
from .common import test_input_path, test_output_path
66

7-
def test_remesh():
7+
def test_smooth_remesh():
88
pass

0 commit comments

Comments
 (0)