PATH:
opt
/
bitninja-python-dojo
/
embedded
/
lib
/
python3.9
/
tkinter
/
test
/
test_tkinter
import unittest import tkinter from test.support import requires, swap_attr from tkinter.test.support import AbstractTkTest from tkinter import colorchooser requires('gui') class ChooserTest(AbstractTkTest, unittest.TestCase): @classmethod def setUpClass(cls): AbstractTkTest.setUpClass.__func__(cls) cls.cc = colorchooser.Chooser(initialcolor='dark blue slate') def test_fixoptions(self): cc = self.cc cc._fixoptions() self.assertEqual(cc.options['initialcolor'], 'dark blue slate') cc.options['initialcolor'] = '#D2D269691E1E' cc._fixoptions() self.assertEqual(cc.options['initialcolor'], '#D2D269691E1E') cc.options['initialcolor'] = (210, 105, 30) cc._fixoptions() self.assertEqual(cc.options['initialcolor'], '#d2691e') def test_fixresult(self): cc = self.cc self.assertEqual(cc._fixresult(self.root, ()), (None, None)) self.assertEqual(cc._fixresult(self.root, ''), (None, None)) self.assertEqual(cc._fixresult(self.root, 'chocolate'), ((210, 105, 30), 'chocolate')) self.assertEqual(cc._fixresult(self.root, '#4a3c8c'), ((74, 60, 140), '#4a3c8c')) if __name__ == "__main__": unittest.main()
[-] test_font.py
[edit]
[+]
..
[-] test_misc.py
[edit]
[-] test_colorchooser.py
[edit]
[-] test_widgets.py
[edit]
[-] test_loadtk.py
[edit]
[+]
__pycache__
[-] test_geometry_managers.py
[edit]
[-] test_simpledialog.py
[edit]
[-] test_text.py
[edit]
[-] __init__.py
[edit]
[-] test_variables.py
[edit]
[-] test_images.py
[edit]