/usr/lib/python2.7/dist-packages/cssutils/tests/test_cssutilsimport.py is in python-cssutils 1.0.2-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 | """Testcase for cssutils imports"""
before = len(locals()) # to check is only exp amount is imported
from cssutils import *
after = len(locals()) # to check is only exp amount is imported
import unittest
class CSSutilsImportTestCase(unittest.TestCase):
def test_import_all(self):
"from cssutils import *"
import cssutils
act = globals()
exp = {'CSSParser': CSSParser,
'CSSSerializer': CSSSerializer,
'css': cssutils.css,
'stylesheets': cssutils.stylesheets,
}
exptotal = before + len(exp) + 1
# imports before + * + "after"
self.assertTrue(after == exptotal, 'too many imported')
found = 0
for e in exp:
self.assertTrue(e in act, '%s not found' %e)
self.assertTrue(act[e] == exp[e], '%s not the same' %e)
found += 1
self.assertTrue(found == len(exp))
if __name__ == '__main__':
import unittest
unittest.main()
|