-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1bf925
commit 09b543e
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import io | ||
from pathlib import Path | ||
|
||
import meshlib.mrmeshpy as mm | ||
import pytest | ||
from constants import test_files_path | ||
from helpers.meshlib_helpers import compare_meshes_similarity | ||
|
||
|
||
@pytest.mark.smoke | ||
@pytest.mark.bindingsV3 | ||
def test_issue_5501_read(tmp_path): | ||
input_folder = Path(test_files_path) / "issues" / "5501" | ||
in_file = input_folder / "input.ctm" | ||
with open(in_file, "rb") as file_handler: | ||
buf = io.BytesIO(file_handler.read()) | ||
mrmesh = mm.loadMesh(buf, "*.ctm") | ||
mm.saveMesh(mrmesh, tmp_path / "out_read.ctm") | ||
compare_meshes_similarity(in_file, tmp_path / "out_read.ctm") | ||
|
||
@pytest.mark.smoke | ||
@pytest.mark.bindingsV3 | ||
def test_issue_2899_write(tmp_path): | ||
input_folder = Path(test_files_path) / "issues" / "5501" | ||
in_file = input_folder / "input.ctm" | ||
mrmesh = mm.loadMesh(in_file) | ||
with io.BytesIO() as byte_stream: | ||
mm.saveMesh(mrmesh, out=byte_stream, extension="*.ctm") | ||
with open(tmp_path / "out_write.ctm", "wb") as f: | ||
f.write(byte_stream.getbuffer()) | ||
|
||
compare_meshes_similarity(in_file, tmp_path / "out_write.ctm") |