test_compression.py 文件源码

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

项目:incubator-airflow-old 作者: apache 项目源码 文件源码
def test_uncompress_file(self):
        # Testing txt file type
        self.assertRaisesRegexp(NotImplementedError,
                                "^Received .txt format. Only gz and bz2.*",
                                compression.uncompress_file,
                                **{'input_file_name': None,
                                   'file_extension': '.txt',
                                   'dest_dir': None
                                   })
        # Testing gz file type
        fn_txt = self._get_fn('.txt')
        fn_gz = self._get_fn('.gz')
        txt_gz = compression.uncompress_file(fn_gz, '.gz', self.tmp_dir)
        self.assertTrue(filecmp.cmp(txt_gz, fn_txt, shallow=False),
                        msg="Uncompressed file doest match original")
        # Testing bz2 file type
        fn_bz2 = self._get_fn('.bz2')
        txt_bz2 = compression.uncompress_file(fn_bz2, '.bz2', self.tmp_dir)
        self.assertTrue(filecmp.cmp(txt_bz2, fn_txt, shallow=False),
                        msg="Uncompressed file doest match original")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号