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
评论列表
文章目录