##// END OF EJS Templates
simplified copy_files logic
Paul Ivanov -
Show More
@@ -108,18 +108,14 b' class TestsBase(object):'
108 return temp_dir
108 return temp_dir
109
109
110
110
111 def copy_files_to(self, copy_filenames=None, destination=None):
111 def copy_files_to(self, copy_filenames, dest='.'):
112
112 "Copy test files into the destination directory"
113 #Copy test files into the destination directory.
113 if not os.path.isdir(dest):
114 if copy_filenames:
114 os.makedirs(dest)
115 files_path = self._get_files_path()
115 for pattern in copy_filenames:
116 for pattern in copy_filenames:
116 for match in glob.glob(os.path.join(self._get_files_path(), pattern)):
117 for match in glob.glob(os.path.join(files_path, pattern)):
117 if destination is None:
118 shutil.copyfile(match, os.path.join(dest, os.path.basename(match)))
118 shutil.copyfile(match, os.path.basename(match))
119 else:
120 if not os.path.isdir(destination):
121 os.makedirs(destination)
122 shutil.copyfile(match, os.path.join(destination, os.path.basename(match)))
123
119
124
120
125 def _get_files_path(self):
121 def _get_files_path(self):
General Comments 0
You need to be logged in to leave comments. Login now