2424Tests for methods in processing.py
2525"""
2626
27+ import os
2728import unittest
2829import numpy as np
2930import discorpy .proc .processing as proc
@@ -267,7 +268,10 @@ def test_transform_coef_backward_and_forward(self):
267268 self .assertTrue (num1 <= 1.0e-3 and num2 <= 1.0e-3 )
268269
269270 def test_find_center_based_vanishing_points (self ):
270- data = losa .load_python_list ("./data_for_test/data_for_pers_cod.pkl" )
271+ current_dir = os .path .dirname (__file__ )
272+ data_path = os .path .join (current_dir , "data_for_test" ,
273+ "data_for_pers_cod.pkl" )
274+ data = losa .load_python_list (data_path )
271275 list_hor_lines , list_ver_lines = data
272276 xcenter0 , ycenter0 = 2005 , 1520
273277 xcenter1 , ycenter1 = proc .find_center_based_vanishing_points (
@@ -277,7 +281,10 @@ def test_find_center_based_vanishing_points(self):
277281 self .assertTrue (num1 <= 10.0 and num2 <= 10.0 )
278282
279283 def test_correct_perspective_effect (self ):
280- data = losa .load_python_list ("./data_for_test/data_for_pers_cod.pkl" )
284+ current_dir = os .path .dirname (__file__ )
285+ data_path = os .path .join (current_dir , "data_for_test" ,
286+ "data_for_pers_cod.pkl" )
287+ data = losa .load_python_list (data_path )
281288 list_hor_lines , list_ver_lines = data
282289 xcenter , ycenter = proc .find_center_based_vanishing_points (
283290 list_hor_lines , list_ver_lines )
@@ -295,7 +302,10 @@ def test_correct_perspective_effect(self):
295302 num3 <= 2.0e-3 and num4 <= 2.0e-3 )
296303
297304 def test_find_center_based_vanishing_points_iteration (self ):
298- data = losa .load_python_list ("./data_for_test/data_for_pers_cod.pkl" )
305+ current_dir = os .path .dirname (__file__ )
306+ data_path = os .path .join (current_dir , "data_for_test" ,
307+ "data_for_pers_cod.pkl" )
308+ data = losa .load_python_list (data_path )
299309 list_hor_lines , list_ver_lines = data
300310 xcenter0 , ycenter0 = 2005 , 1520
301311 xcenter1 , ycenter1 = proc .find_center_based_vanishing_points_iteration (
0 commit comments