ยปCore Development>Code coverage>Lib/idlelib/idle_test/test_colorizer.py

Python code coverage for Lib/idlelib/idle_test/test_colorizer.py

#countcontent
1n/a'''Test idlelib/colorizer.py
2n/a
3n/aPerform minimal sanity checks that module imports and some things run.
4n/a
5n/aCoverage 22%.
6n/a'''
7n/afrom idlelib import colorizer # always test import
8n/afrom test.support import requires
9n/afrom tkinter import Tk, Text
10n/aimport unittest
11n/a
12n/a
13n/aclass FunctionTest(unittest.TestCase):
14n/a
15n/a def test_any(self):
16n/a self.assertTrue(colorizer.any('test', ('a', 'b')))
17n/a
18n/a def test_make_pat(self):
19n/a self.assertTrue(colorizer.make_pat())
20n/a
21n/a
22n/aclass ColorConfigTest(unittest.TestCase):
23n/a
24n/a @classmethod
25n/a def setUpClass(cls):
26n/a requires('gui')
27n/a cls.root = Tk()
28n/a cls.text = Text(cls.root)
29n/a
30n/a @classmethod
31n/a def tearDownClass(cls):
32n/a del cls.text
33n/a cls.root.destroy()
34n/a del cls.root
35n/a
36n/a def test_colorizer(self):
37n/a colorizer.color_config(self.text)
38n/a
39n/aclass ColorDelegatorTest(unittest.TestCase):
40n/a
41n/a @classmethod
42n/a def setUpClass(cls):
43n/a requires('gui')
44n/a cls.root = Tk()
45n/a
46n/a @classmethod
47n/a def tearDownClass(cls):
48n/a cls.root.destroy()
49n/a del cls.root
50n/a
51n/a def test_colorizer(self):
52n/a colorizer.ColorDelegator()
53n/a
54n/a
55n/aif __name__ == '__main__':
56n/a unittest.main(verbosity=2)