test.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:rtf2xml 作者: paulhtremblay 项目源码 文件源码
def __test_bad(self):
        paths = os.listdir(self.__invalid_dir)
        for path in paths:
            path = os.path.join(self.__invalid_dir, path)
            filename, ext = os.path.splitext(path)
            if ext != '.rtf':
                continue
            if os.path.isdir(path):
                continue
            new_filename = tempfile.mktemp()
            out_path = os.path.join(self.__out_dir, new_filename)
            status, msg = self.__run_script(in_file = path, out_file = out_path)
            if not status:
                info = [path, 'Should have produced an error']
                self.__error.append(info)
            try:
                os.remove(out_path)
            except OSError:
                pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号