File: test_descriptive_elements.py

package info (click to toggle)
python-svgelements 1.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 764 kB
  • sloc: python: 11,859; sh: 6; makefile: 3
file content (20 lines) | stat: -rw-r--r-- 581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import io
import unittest

from svgelements import *


class TestDescriptiveElements(unittest.TestCase):

    def test_descriptive_element(self):
        q = io.StringIO(u'''<?xml version="1.0" encoding="utf-8" ?>\n
                        <svg>
                        <title>Who?</title>
                        <desc>My Friend.</desc>
                        </svg>''')
        m = SVG.parse(q)
        q = list(m.elements())
        self.assertEqual(len(q), 3)
        self.assertEqual(q[1].title, "Who?")
        self.assertEqual(q[2].desc, "My Friend.")