def test_with_rebased_files_returns_same_args_when_there_are_no_files( self): args = FileinfoArguments() rebased_args = args.with_rebased_files( Directory(os.path.join(ROOT_DIR, 'inputs')), Directory(os.path.join(ROOT_DIR, 'outputs'))) self.assertEqual(args, rebased_args)
def test_with_rebased_files_returns_correct_args_when_there_are_files( self): args = FileinfoArguments(input_files=(StandaloneFile('file.exe'), ), config_file=StandaloneFile('file.json')) rebased_args = args.with_rebased_files( Directory(os.path.join(ROOT_DIR, 'inputs')), Directory(os.path.join(ROOT_DIR, 'outputs'))) self.assertEqual(len(rebased_args.input_files), 1) self.assertEqual(rebased_args.input_files[0].path, os.path.join(ROOT_DIR, 'inputs', 'file.exe')) self.assertEqual(rebased_args.config_file.path, os.path.join(ROOT_DIR, 'outputs', 'file.json'))