File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ '''Test idlelib/colorizer.py
2+
3+ Perform minimal sanity checks that module imports and some things run.
4+
5+ Coverage 22%.
6+ '''
7+ from idlelib import colorizer # always test import
8+ from test .support import requires
9+ from tkinter import Tk , Text
10+ import unittest
11+
12+
13+ class FunctionTest (unittest .TestCase ):
14+
15+ def test_any (self ):
16+ self .assertTrue (colorizer .any ('test' , ('a' , 'b' )))
17+
18+ def test_make_pat (self ):
19+ self .assertTrue (colorizer .make_pat ())
20+
21+
22+ class ColorConfigTest (unittest .TestCase ):
23+
24+ @classmethod
25+ def setUpClass (cls ):
26+ requires ('gui' )
27+ cls .root = Tk ()
28+ cls .text = Text (cls .root )
29+
30+ @classmethod
31+ def tearDownClass (cls ):
32+ del cls .text
33+ cls .root .destroy ()
34+ del cls .root
35+
36+ def test_colorizer (self ):
37+ colorizer .color_config (self .text )
38+
39+ class ColorDelegatorTest (unittest .TestCase ):
40+
41+ @classmethod
42+ def setUpClass (cls ):
43+ requires ('gui' )
44+ cls .root = Tk ()
45+
46+ @classmethod
47+ def tearDownClass (cls ):
48+ cls .root .destroy ()
49+ del cls .root
50+
51+ def test_colorizer (self ):
52+ colorizer .ColorDelegator ()
53+
54+
55+ if __name__ == '__main__' :
56+ unittest .main (verbosity = 2 )
You can’t perform that action at this time.
0 commit comments