Exemple #1
0
 def test_no_rbrace(self):
     src = u'.myclass { rule: #abc ; '
     parser = Parser(src)
     self.assertTrue(parser.match(tokens.START))
     with self.assertRaises(errors.CSSSyntaxError):
         parser.ruleset()
     
     src = u'.myclass { rule: #abc ; \n@import "mycssfile.css"'
     parser = Parser(src)
     self.assertTrue(parser.match(tokens.START))
     with self.assertRaises(errors.CSSSyntaxError):
         parser.ruleset()
Exemple #2
0
 def test_lineno(self):
     src = u'.myclass {} '
     parser = Parser(src)
     self.assertTrue(parser.match(tokens.START))
     ruleset = parser.ruleset()
     self.assertEqual(1, ruleset.lineno)
Exemple #3
0
 def test_no_lbrace(self):
     src = u'.myclass  '
     parser = Parser(src)
     self.assertTrue(parser.match(tokens.START))
     with self.assertRaises(errors.CSSSyntaxError):
         parser.ruleset()