/usr/share/pyshared/cssutils/tests/test_x.py is in python-cssutils 0.9.10-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | """Testcases for cssutils.css.CSSValue and CSSPrimitiveValue."""
__version__ = '$Id: test_cssvalue.py 1473 2008-09-15 21:15:54Z cthedot $'
# from decimal import Decimal # maybe for later tests?
import xml.dom
import basetest
import cssutils
import types
class XTestCase(basetest.BaseTestCase):
def setUp(self):
cssutils.ser.prefs.useDefaults()
def tearDown(self):
cssutils.ser.prefs.useDefaults()
def test_prioriy(self):
"Property.priority"
s = cssutils.parseString(u'a { color: red }')
self.assertEqual(s.cssText, u'a {\n color: red\n }'.encode())
# self.assertEqual(u'', s.cssRules[0].style.getPropertyPriority('color'))
#
# s = cssutils.parseString('a { color: red !important }')
# self.assertEqual(u'a {\n color: red !important\n }', s.cssText)
# self.assertEqual(u'important', s.cssRules[0].style.getPropertyPriority('color'))
#
# cssutils.log.raiseExceptions = True
# p = cssutils.css.Property(u'color', u'red', u'')
# self.assertEqual(p.priority, u'')
# p = cssutils.css.Property(u'color', u'red', u'!important')
# self.assertEqual(p.priority, u'important')
# self.assertRaisesMsg(xml.dom.SyntaxErr,
# u'',
# cssutils.css.Property, u'color', u'red', u'x')
#
# cssutils.log.raiseExceptions = False
# p = cssutils.css.Property(u'color', u'red', u'!x')
# self.assertEqual(p.priority, u'x')
# p = cssutils.css.Property(u'color', u'red', u'!x')
# self.assertEqual(p.priority, u'x')
# cssutils.log.raiseExceptions = True
#
#
# # invalid but kept!
## #cssutils.log.raiseExceptions = False
## s = cssutils.parseString('a { color: red !x }')
## self.assertEqual(u'a {\n color: red !x\n }', s.cssText)
## self.assertEqual(u'x', s.cssRules[0].style.getPropertyPriority('color'))
#
if __name__ == '__main__':
import unittest
unittest.main()
|