Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_percentage_conversion(self):
"Test percentage length attribute conversion."
ac = svglib.Svg2RlgAttributeConverter()
ac.set_box(svglib.Box(0, 0, 50, 150))
# Percentages depend on current viewport and type of attribute
length = ac.convertLength("1e1%", attr_name='width')
assert length == 5
length = ac.convertLength("1e1%", attr_name='height')
assert length == 15