File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
tests/compas/datastructures Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 11import os
2+ import tempfile
23
34import pytest
45
@@ -167,13 +168,15 @@ def test_from_ploygons():
167168# --------------------------------------------------------------------------
168169
169170def test_to_obj ():
170- mesh = Mesh .from_obj (compas .get ('faces.obj' ))
171- mesh .to_obj ('data/temp.obj' )
172- mesh = Mesh .from_obj (compas .get ('temp.obj' ))
173- assert mesh .number_of_faces () == 25
174- assert mesh .number_of_vertices () == 36
175- assert mesh .number_of_edges () == 60
176- os .remove (compas .get ('temp.obj' ))
171+ with tempfile .TemporaryDirectory () as tempdir :
172+ fname = os .path .join (tempdir , 'temp.obj' )
173+ mesh = Mesh .from_obj (compas .get ('faces.obj' ))
174+ mesh .to_obj (fname )
175+ mesh = Mesh .from_obj (fname )
176+ assert mesh .number_of_faces () == 25
177+ assert mesh .number_of_vertices () == 36
178+ assert mesh .number_of_edges () == 60
179+ os .remove (fname )
177180
178181
179182def test_to_vertices_and_faces ():
You can’t perform that action at this time.
0 commit comments