def test_subelement_tspan(self): txt = TextPath('#test', 'text') txt.add(TSpan('subtext')) self.assertEqual( txt.tostring(), '<textPath xlink:href="#test">text<tspan>subtext</tspan></textPath>' )
def test_constructor(self): tref = TextPath('#test', 'The Text', startOffset=10, spacing='auto', method='stretch') self.assertEqual(tref.tostring(), '<textPath method="stretch" spacing="auto"' \ ' startOffset="10" xlink:href="#test">The Text</textPath>')
def test_subelement_tspan(self): txt = TextPath('#test', 'text') txt.add(TSpan('subtext')) self.assertEqual(txt.tostring(), '<textPath xlink:href="#test">text<tspan>subtext</tspan></textPath>')