From 3d99c5f507616f846ee95c1cdcee009a7746a76f Mon Sep 17 00:00:00 2001 From: Delio Vicini Date: Tue, 14 Mar 2023 20:08:41 +0000 Subject: [PATCH] Change tests to consistently use data from the resources directory --- src/emitters/tests/data/__init__.py | 0 src/emitters/tests/data/triangle.ply | 14 -------------- src/emitters/tests/test_area.py | 2 +- src/emitters/tests/test_directionalarea.py | 2 +- src/render/tests/data/triangle.ply | 14 -------------- src/render/tests/data/triangle_face_colors.ply | Bin 389 -> 0 bytes src/render/tests/test_mesh.py | 6 +++--- 7 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 src/emitters/tests/data/__init__.py delete mode 100644 src/emitters/tests/data/triangle.ply delete mode 100644 src/render/tests/data/triangle.ply delete mode 100644 src/render/tests/data/triangle_face_colors.ply diff --git a/src/emitters/tests/data/__init__.py b/src/emitters/tests/data/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/emitters/tests/data/triangle.ply b/src/emitters/tests/data/triangle.ply deleted file mode 100644 index ad2c269ea..000000000 --- a/src/emitters/tests/data/triangle.ply +++ /dev/null @@ -1,14 +0,0 @@ -ply -format ascii 1.0 -comment this file contains a triangle -element vertex 3 -property float x -property float y -property float z -element face 1 -property list uchar int vertex_index -end_header -0 0 0 -0 0 1 -0 1 0 -3 0 1 2 diff --git a/src/emitters/tests/test_area.py b/src/emitters/tests/test_area.py index 0d0fe8afd..a4120888f 100644 --- a/src/emitters/tests/test_area.py +++ b/src/emitters/tests/test_area.py @@ -22,7 +22,7 @@ def create_emitter_and_spectrum(s_key='d65'): emitter = mi.load_dict({ "type": "ply", - "filename": "data/triangle.ply", + "filename": "resources/data/tests/ply/triangle.ply", "emitter" : { "type": "area", "radiance" : spectrum_dicts[s_key] }, "to_world" : mi.ScalarTransform4f.translate([10, -1, 2]) }) diff --git a/src/emitters/tests/test_directionalarea.py b/src/emitters/tests/test_directionalarea.py index 6dd75bc90..c838741e0 100644 --- a/src/emitters/tests/test_directionalarea.py +++ b/src/emitters/tests/test_directionalarea.py @@ -22,7 +22,7 @@ def create_emitter_and_spectrum(s_key='d65'): emitter = mi.load_dict({ "type": "ply", - "filename": "data/triangle.ply", + "filename": "resources/data/tests/ply/triangle.ply", "emitter" : { "type": "directionalarea", "radiance" : spectrum_dicts[s_key] }, "to_world" : mi.ScalarTransform4f.translate([10, -1, 2]) }) diff --git a/src/render/tests/data/triangle.ply b/src/render/tests/data/triangle.ply deleted file mode 100644 index ad2c269ea..000000000 --- a/src/render/tests/data/triangle.ply +++ /dev/null @@ -1,14 +0,0 @@ -ply -format ascii 1.0 -comment this file contains a triangle -element vertex 3 -property float x -property float y -property float z -element face 1 -property list uchar int vertex_index -end_header -0 0 0 -0 0 1 -0 1 0 -3 0 1 2 diff --git a/src/render/tests/data/triangle_face_colors.ply b/src/render/tests/data/triangle_face_colors.ply deleted file mode 100644 index afe55668c85b5bc316dff2f1b03ee8b69c9a9dff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 389 zcmZvXK@Ng25JgdUb?F7VbY(#Ia+Ic)Av7s1Db-Lmas*G{E!>%S7cYV(8fc1>OfvH_ zf96jmEXtKGslg{MskTILV+0V88K)8_yBL9h5~RTw&;}ZOK$TXNt1Zrja>6DAHUw=5 z8uQT@;m$IHdK&xMV@fDZ;{VuN>QC>H`=1m*GtemV lqVKOSul8bw{e2R6jSS3|pSxpcXCuhZ@0dA#3L`T_bTcyj;% diff --git a/src/render/tests/test_mesh.py b/src/render/tests/test_mesh.py index bb4cb3506..1510c3a5e 100644 --- a/src/render/tests/test_mesh.py +++ b/src/render/tests/test_mesh.py @@ -34,7 +34,7 @@ def test01_create_mesh(variant_scalar_rgb): def test02_ply_triangle(variant_scalar_rgb): m = mi.load_dict({ "type" : "ply", - "filename" : "data/triangle.ply", + "filename" : "resources/data/tests/ply/triangle.ply", "face_normals" : True }) @@ -59,7 +59,7 @@ def test03_ply_computed_normals(variant_scalar_rgb): doesn't have them.""" shape = mi.load_dict({ "type" : "ply", - "filename" : "data/triangle.ply", + "filename" : "resources/data/tests/ply/triangle.ply", }) params = mi.traverse(shape) normals = params['vertex_normals'] @@ -168,7 +168,7 @@ def test(): def test07_ply_stored_attribute(variant_scalar_rgb): m = mi.load_dict({ "type" : "ply", - "filename" : "data/triangle_face_colors.ply", + "filename" : "resources/data/tests/ply/triangle_face_colors.ply", }) assert str(m) == """PLYMesh[