Example #1
0
 def test_eof2(self):
     css = "font-variant"
     p = SimpleCSSParser(css)
     self.assertRaises(CSSUnexpectedEOFError, p.parse)
Example #2
0
 def test_eof3(self):
     css = "font-family: 'xxx"
     p = SimpleCSSParser(css)
     self.assertRaises(CSSUnexpectedEOFError, p.parse)
Example #3
0
 def test_missing_semicolon(self):
     css = "font-style: italic font-variant: small-caps"
     p = SimpleCSSParser(css)
     self.assertRaises(CSSMissingSemicolonError, p.parse)
Example #4
0
 def test_illegal_character(self):
     css = u"fonä-variant: small-caps"
     p = SimpleCSSParser(css)
     self.assertRaises(CSSIllegalCharacterError, p.parse)
Example #5
0
 def test_missing_colon(self):
     css = "font-style italic"
     p = SimpleCSSParser(css)
     self.assertRaises(CSSMissingColonError, p.parse)
Example #6
0
 def test_string2(self):
     css = "font-family: \"Garamond\""
     p = SimpleCSSParser(css)
     p.parse()
     d = p.declarations[0]
     self.assertEqual(d[1], "Garamond")
Example #7
0
 def test_semicolon(self):
     css = "font-variant: small-caps;"
     p = SimpleCSSParser(css)
     p.parse()
     d = p.declarations[0]
     self.assertEqual(d[1], "small-caps")
Example #8
0
 def test_property(self):
     css = "font-variant: small-caps"
     p = SimpleCSSParser(css)
     p.parse()
     d = p.declarations[0]
     self.assertEqual(d[0], "font-variant")
Example #9
0
 def test_suite(self):
     css = "font-variant: small-caps;\nfont-weight: bold"
     p = SimpleCSSParser(css)
     p.parse()
     d = p.declarations[1]
     self.assertEqual(len(d), 2)