test_svg.py 文件源码

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

项目:segno 作者: heuer 项目源码 文件源码
def test_write_svg_black3():
    # Test with default options
    qr = segno.make_qr('test')
    out = io.BytesIO()
    qr.save(out, kind='svg', color=(0, 0, 0))
    xml_str = out.getvalue()
    assert xml_str.startswith(b'<?xml')
    root = _parse_xml(out)
    assert 'viewBox' not in root.attrib
    assert 'height' in root.attrib
    assert 'width' in root.attrib
    css_class = root.attrib.get('class')
    assert css_class
    assert 'segno' == css_class
    path_el = _get_path(root)
    assert path_el is not None
    path_class = path_el.get('class')
    assert 'qrline' == path_class
    stroke = path_el.get('stroke')
    assert stroke == '#000'
    title_el = _get_title(root)
    assert title_el is None
    desc_el = _get_desc(root)
    assert desc_el is None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号