@@ -298,20 +298,20 @@ def test_no_handler_is_selected_for_a_non_archive3(self):
298298
299299 def test_7zip_extract_can_extract_to_relative_paths (self ):
300300 # The setup is a tad complex because we want to have a relative dir
301- # to the base dir where we run tests from, ie the scancode-toolkit/ dir
301+ # to the base dir where we run tests from, i.e. the git checkout dir.
302302 # To use relative paths, we use our tmp dir at the root of the code tree
303303 from os .path import dirname , join , abspath
304304 import tempfile
305305 import shutil
306306 from extractcode .sevenzip import extract
307307
308308 test_file = self .get_test_loc ('archive/relative_path/basic.zip' , copy = True )
309- scancode_root = dirname (dirname (dirname (__file__ )))
310- scancode_tmp = join (scancode_root , 'tmp' )
311- fileutils .create_dir (scancode_tmp )
312- scancode_root_abs = abspath (scancode_root )
313- test_src_dir = tempfile .mkdtemp (dir = scancode_tmp ).replace (scancode_root_abs , '' ).strip ('\\ /' )
314- test_tgt_dir = tempfile .mkdtemp (dir = scancode_tmp ).replace (scancode_root_abs , '' ).strip ('\\ /' )
309+ project_root = dirname (dirname (dirname (__file__ )))
310+ project_tmp = join (project_root , 'tmp' )
311+ fileutils .create_dir (project_tmp )
312+ project_root_abs = abspath (project_root )
313+ test_src_dir = tempfile .mkdtemp (dir = project_tmp ).replace (project_root_abs , '' ).strip ('\\ /' )
314+ test_tgt_dir = tempfile .mkdtemp (dir = project_tmp ).replace (project_root_abs , '' ).strip ('\\ /' )
315315 shutil .copy (test_file , test_src_dir )
316316 test_src_file = join (test_src_dir , 'basic.zip' )
317317 result = list (extract (test_src_file , test_tgt_dir ))
@@ -1702,7 +1702,7 @@ def test_extract_twice_with_rpm_with_xz_compressed_cpio(self):
17021702
17031703 def test_extract_twice_can_extract_to_relative_paths (self ):
17041704 # The setup is a tad complex because we want to have a relative dir
1705- # to the base dir where we run tests from, ie the scancode-toolkit/ dir
1705+ # to the base dir where we run tests from, i.e. the git checkout dir
17061706 # To use relative paths, we use our tmp dir at the root of the code tree
17071707 from os .path import dirname , join , abspath , exists
17081708 import shutil
@@ -1712,12 +1712,12 @@ def test_extract_twice_can_extract_to_relative_paths(self):
17121712 # this will return an extractor that extracts twice
17131713 extractor = archive .get_extractor (test_file )
17141714
1715- scancode_root = dirname (dirname (dirname (__file__ )))
1716- scancode_tmp = join (scancode_root , 'tmp' )
1717- fileutils .create_dir (scancode_tmp )
1718- scancode_root_abs = abspath (scancode_root )
1719- test_src_dir = tempfile .mkdtemp (dir = scancode_tmp ).replace (scancode_root_abs , '' ).strip ('\\ /' )
1720- test_tgt_dir = tempfile .mkdtemp (dir = scancode_tmp ).replace (scancode_root_abs , '' ).strip ('\\ /' )
1715+ project_root = dirname (dirname (dirname (__file__ )))
1716+ project_tmp = join (project_root , 'tmp' )
1717+ fileutils .create_dir (project_tmp )
1718+ project_root_abs = abspath (project_root )
1719+ test_src_dir = tempfile .mkdtemp (dir = project_tmp ).replace (project_root_abs , '' ).strip ('\\ /' )
1720+ test_tgt_dir = tempfile .mkdtemp (dir = project_tmp ).replace (project_root_abs , '' ).strip ('\\ /' )
17211721 shutil .copy (test_file , test_src_dir )
17221722 test_src_file = join (test_src_dir , 'xz-compressed-cpio.rpm' )
17231723
0 commit comments