test_00version.py 文件源码

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

项目:cocrawler 作者: cocrawler 项目源码 文件源码
def test_magic():
    '''
    The python filemagic package requires the OS libmagic package,
    so let's test it to be sure nothing's missing
    '''
    with magic.Magic(flags=magic.MAGIC_MIME_TYPE) as m:
        pdf_string = '%PDF-1.3\n'
        assert m.id_buffer(pdf_string) == 'application/pdf'
        html_string = '<html>\n'
        assert m.id_buffer(html_string) == 'text/html'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号