~doctormo/+junk/css-parser

« back to all changes in this revision

Viewing changes to tests/test_parse.py

  • Committer: Martin Owens
  • Date: 2014-07-13 21:48:23 UTC
  • Revision ID: doctormo@gmail.com-20140713214823-774n9vbbhw93zlbh
Move the files around and add some simple events

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
sys.path.insert(0, '../')
22
22
 
23
23
import unittest
24
 
from css import _parse_css
 
24
from csslavie.parse import _parse_css
25
25
try:
26
26
    from test import test_support
27
27
except ImportError:
34
34
        with open("data/test1.css", 'r') as fhl:
35
35
            css = _parse_css(fhl.read())
36
36
 
37
 
        self.assertEqual(len(css), 4)
 
37
        self.assertEqual(len(css), 5)
38
38
        self.assertEqual( css[0][0][0], 'name' )
39
39
        self.assertEqual( css[1][0][0], '.name' )
40
40
        self.assertEqual( css[2][0][0], '#name' )
41
41
        self.assertEqual( css[3][0][0], 'name .name #name' )
 
42
        self.assertEqual( css[4][0][0], 'name #parent' )
42
43
 
43
44
        self.assertEqual( css[0][1]['value'], 1 )
44
45
        self.assertEqual( css[1][1]['value'], 3 )