2222def test_dfb_test_simple ():
2323 assert dfb .dfb_test .test () == True , "The test function should return True"
2424
25+ # getting the test data pahts
26+ def get_ply_cloud_roof_quarter_path ():
27+ base_test_data_dir = os .getenv ('TEST_DATA_DIR' , os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' , '..' , 'test_data' )))
28+ ply_file_path = os .path .join (base_test_data_dir , "roof_quarter.ply" )
29+ if not os .path .exists (ply_file_path ):
30+ raise FileNotFoundError (f"PLY file not found at: { ply_file_path } " )
31+ return ply_file_path
32+
2533#------------------------------------------------------------------------------
2634# dfb_geometry namespace
2735#------------------------------------------------------------------------------
@@ -37,11 +45,11 @@ def test_DFPointCloud_init():
3745
3846def test_DFPointCloud_load_from_PLY ():
3947 pc = dfb .dfb_geometry .DFPointCloud ()
40- test_data_dir = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' , '..' , 'test_data' ))
41- ply_file_path = os .path .join (test_data_dir , "roof_quarter.ply" )
42- if not os .path .exists (ply_file_path ):
43- raise FileNotFoundError (f"PLY file not found at: { ply_file_path } " )
44- pc .load_from_PLY (ply_file_path )
48+ # test_data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'test_data'))
49+ # ply_file_path = os.path.join(test_data_dir, "roof_quarter.ply")
50+ # if not os.path.exists(ply_file_path):
51+ # raise FileNotFoundError(f"PLY file not found at: {ply_file_path}")
52+ pc .load_from_PLY (get_ply_cloud_roof_quarter_path () )
4553
4654 assert pc .points .__len__ () == 7379 , "DFPointCloud should have 7379 points"
4755 assert pc .normals .__len__ () == 7379 , "DFPointCloud should have 7379 normals"
@@ -50,11 +58,11 @@ def test_DFPointCloud_load_from_PLY():
5058@pytest .fixture
5159def create_DFPointCloudSampleRoof ():
5260 df_pcd = dfb .dfb_geometry .DFPointCloud ()
53- test_data_dir = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' , '..' , 'test_data' ))
54- ply_file_path = os .path .join (test_data_dir , "roof_quarter.ply" )
55- if not os .path .exists (ply_file_path ):
56- raise FileNotFoundError (f"PLY file not found at: { ply_file_path } " )
57- df_pcd .load_from_PLY (ply_file_path )
61+ # test_data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'test_data'))
62+ # ply_file_path = os.path.join(test_data_dir, "roof_quarter.ply")
63+ # if not os.path.exists(ply_file_path):
64+ # raise FileNotFoundError(f"PLY file not found at: {ply_file_path}")
65+ df_pcd .load_from_PLY (get_ply_cloud_roof_quarter_path () )
5866 yield df_pcd
5967
6068def test_DFPointCloud_properties (create_DFPointCloudSampleRoof ):
0 commit comments