File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -421,6 +421,14 @@ def process_args(args):
421421 if hasattr (args , "items_to_process" ) and not isinstance (args .items_to_process , list ):
422422 args .items_to_process = [args .items_to_process ]
423423
424+ # Check that everything is an absolute path (should have been converted, if needed, during
425+ # validate_paths).
426+ if hasattr (args , "items_to_process" ):
427+ for item in args .items_to_process :
428+ assert os .path .isabs (item )
429+ if hasattr (args , "target_root" ):
430+ assert os .path .isabs (args .target_root )
431+
424432 # Check that every item in items_to_process is a child of inputdata_root
425433 if hasattr (args , "items_to_process" ): # Sometimes doesn't if we're testing
426434 for item in args .items_to_process :
Original file line number Diff line number Diff line change @@ -371,16 +371,16 @@ def test_error_if_source_not_in_inputdata(self):
371371 args = argparse .Namespace (
372372 quiet = False ,
373373 verbose = False ,
374- items_to_process = "abc123" ,
375- inputdata_root = "def456" ,
374+ items_to_process = os . path . abspath ( "abc123" ) ,
375+ inputdata_root = os . path . abspath ( "def456" ) ,
376376 )
377377 with pytest .raises (argparse .ArgumentTypeError ) as exc_info :
378378 relink .process_args (args )
379379 assert "not under inputdata root" in str (exc_info .value )
380380
381381 def test_error_if_target_in_inputdata (self ):
382382 """Test that process_args errors if target is in inputdata_root."""
383- inputdata_root = "inputdata"
383+ inputdata_root = os . path . abspath ( "inputdata" )
384384 target_root = os .path .join (inputdata_root , "abc123" )
385385 args = argparse .Namespace (
386386 quiet = False ,
You can’t perform that action at this time.
0 commit comments