GRAYBYTE WORDPRESS FILE MANAGER2256

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /lib64/python2.7/lib-tk/test/test_ttk/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /lib64/python2.7/lib-tk/test/test_ttk//test_style.py
import unittest
import Tkinter as tkinter
import ttk
from test.test_support import requires, run_unittest
from test_ttk.support import AbstractTkTest

requires('gui')

class StyleTest(AbstractTkTest, unittest.TestCase):

    def setUp(self):
        super(StyleTest, self).setUp()
        self.style = ttk.Style(self.root)


    def test_configure(self):
        style = self.style
        style.configure('TButton', background='yellow')
        self.assertEqual(style.configure('TButton', 'background'),
            'yellow')
        self.assertIsInstance(style.configure('TButton'), dict)


    def test_map(self):
        style = self.style
        style.map('TButton', background=[('active', 'background', 'blue')])
        self.assertEqual(style.map('TButton', 'background'),
            [('active', 'background', 'blue')] if self.wantobjects else
            [('active background', 'blue')])
        self.assertIsInstance(style.map('TButton'), dict)


    def test_lookup(self):
        style = self.style
        style.configure('TButton', background='yellow')
        style.map('TButton', background=[('active', 'background', 'blue')])

        self.assertEqual(style.lookup('TButton', 'background'), 'yellow')
        self.assertEqual(style.lookup('TButton', 'background',
            ['active', 'background']), 'blue')
        self.assertEqual(style.lookup('TButton', 'optionnotdefined',
            default='iknewit'), 'iknewit')


    def test_layout(self):
        style = self.style
        self.assertRaises(tkinter.TclError, style.layout, 'NotALayout')
        tv_style = style.layout('Treeview')

        # "erase" Treeview layout
        style.layout('Treeview', '')
        self.assertEqual(style.layout('Treeview'),
            [('null', {'sticky': 'nswe'})]
        )

        # restore layout
        style.layout('Treeview', tv_style)
        self.assertEqual(style.layout('Treeview'), tv_style)

        # should return a list
        self.assertIsInstance(style.layout('TButton'), list)

        # correct layout, but "option" doesn't exist as option
        self.assertRaises(tkinter.TclError, style.layout, 'Treeview',
            [('name', {'option': 'inexistent'})])


    def test_theme_use(self):
        self.assertRaises(tkinter.TclError, self.style.theme_use,
            'nonexistingname')

        curr_theme = self.style.theme_use()
        new_theme = None
        for theme in self.style.theme_names():
            if theme != curr_theme:
                new_theme = theme
                self.style.theme_use(theme)
                break
        else:
            # just one theme available, can't go on with tests
            return

        self.assertFalse(curr_theme == new_theme)
        self.assertFalse(new_theme != self.style.theme_use())

        self.style.theme_use(curr_theme)


tests_gui = (StyleTest, )

if __name__ == "__main__":
    run_unittest(*tests_gui)

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 15 2024 08:34:31
root / root
0755
__init__.py
0 KB
April 10 2024 04:58:34
root / root
0644
__init__.pyc
0.137 KB
April 10 2024 04:58:44
root / root
0644
__init__.pyo
0.137 KB
April 10 2024 04:58:44
root / root
0644
support.py
3.643 KB
April 10 2024 04:58:34
root / root
0644
support.pyc
5.215 KB
April 10 2024 04:58:44
root / root
0644
support.pyo
5.215 KB
April 10 2024 04:58:44
root / root
0644
test_extensions.py
11.208 KB
April 10 2024 04:58:34
root / root
0644
test_extensions.pyc
9.935 KB
April 10 2024 04:58:44
root / root
0644
test_extensions.pyo
9.935 KB
April 10 2024 04:58:44
root / root
0644
test_functions.py
16.937 KB
April 10 2024 04:58:34
root / root
0644
test_functions.pyc
15.658 KB
April 10 2024 04:58:44
root / root
0644
test_functions.pyo
15.658 KB
April 10 2024 04:58:44
root / root
0644
test_style.py
2.846 KB
April 10 2024 04:58:34
root / root
0644
test_style.pyc
3.22 KB
April 10 2024 04:58:44
root / root
0644
test_style.pyo
3.22 KB
April 10 2024 04:58:44
root / root
0644
test_widgets.py
59.39 KB
April 10 2024 04:58:34
root / root
0644
test_widgets.pyc
60.39 KB
April 10 2024 04:58:44
root / root
0644
test_widgets.pyo
60.39 KB
April 10 2024 04:58:44
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF