Exemple #1
0
 def test_subelement(self):
     txt = TSpan('testtext')
     txt.add(TSpan('subtext1'))
     txt.add(TSpan('subtext2'))
     self.assertEqual(
         txt.tostring(),
         '<tspan>testtext<tspan>subtext1</tspan><tspan>subtext2</tspan></tspan>'
     )
Exemple #2
0
 def test_non_us_ascii_chars(self):
     txt = TSpan('öäü')
     self.assertEqual(txt.tostring(), to_unicode('<tspan>öäü</tspan>'))
Exemple #3
0
 def test_rotate_values(self):
     txt = TSpan('text', rotate=[1, 2, 3, 4])
     self.assertEqual(txt.tostring(),
                      '<tspan rotate="1 2 3 4">text</tspan>')
Exemple #4
0
 def test_dy_values(self):
     txt = TSpan('text', dy=[1, 2, 3, 4])
     self.assertEqual(txt.tostring(), '<tspan dy="1 2 3 4">text</tspan>')
Exemple #5
0
 def test_insert(self):
     txt = TSpan('testtext', insert=(1, 1))
     self.assertEqual(txt.tostring(), '<tspan x="1" y="1">testtext</tspan>')
Exemple #6
0
 def test_non_us_ascii_chars(self):
     txt = TSpan('öäü')
     self.assertEqual(txt.tostring(), to_unicode('<tspan>öäü</tspan>'))
Exemple #7
0
 def test_constructor(self):
     txt = TSpan('testtext')
     self.assertEqual(txt.tostring(), '<tspan>testtext</tspan>')
Exemple #8
0
 def test_subelement_tspan(self):
     txt = TSpan('text')
     txt.add(TSpan('subtext'))
     self.assertEqual(txt.tostring(), '<tspan>text<tspan>subtext</tspan></tspan>')
Exemple #9
0
 def test_rotate_values(self):
     txt = TSpan('text', rotate=[1,2,3,4])
     self.assertEqual(txt.tostring(), '<tspan rotate="1 2 3 4">text</tspan>')
Exemple #10
0
 def test_dy_values(self):
     txt = TSpan('text', dy=[1,2,3,4])
     self.assertEqual(txt.tostring(), '<tspan dy="1 2 3 4">text</tspan>')
Exemple #11
0
 def test_insert(self):
     txt = TSpan('testtext', insert=(1,1))
     self.assertEqual(txt.tostring(), '<tspan x="1" y="1">testtext</tspan>')
Exemple #12
0
 def test_constructor(self):
     txt = TSpan('testtext')
     self.assertEqual(txt.tostring(), '<tspan>testtext</tspan>')