File: test_block.py

package info (click to toggle)
python-enable 4.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,280 kB
  • ctags: 13,899
  • sloc: cpp: 48,447; python: 28,502; ansic: 9,004; makefile: 315; sh: 44
file content (13 lines) | stat: -rw-r--r-- 516 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
import unittest
from enable.savage.svg.css import block

class TestBlockParsing(unittest.TestCase):
    def testBlock(self):
        """ Not a valid CSS statement, but a valid block
            This tests some abuses of quoting and escaping
            See http://www.w3.org/TR/REC-CSS2/syndata.html Section 4.1.6
        """
        self.assertEqual(
            [["causta:", '"}"', "+", "(", ["7"], "*", "'\\''", ")"]],
            block.block.parseString(r"""{ causta: "}" + ({7} * '\'') }""").asList()
        )