def test_moveto(self): target_dir = os.path.abspath(os.path.join(self.__location, 'moveto')) for file_ in self.__tmp_files: clf.moveto(file_, self.__location, target_dir) for file_ in self.__tmp_files: final_file_path = os.path.join(target_dir, file_) self.assertTrue(os.path.exists(final_file_path))
def test_moveto(self): os.chdir(self.__location) tmp_file = open(self.__tmp_file_name, 'w') parent_dir = os.path.abspath(os.path.join(self.__location, os.pardir)) clf.moveto(self.__tmp_file_name, self.__location, parent_dir) final_file_path = os.path.join(parent_dir, self.__tmp_file_name) self.assertTrue(os.path.exists(final_file_path)) os.remove(final_file_path)