mirror of
https://github.com/python/cpython.git
synced 2025-09-18 14:40:43 +00:00
Issue #28572: Use system-specific values for configdialog font test
This commit is contained in:
parent
1994dd360b
commit
0180cf6684
2 changed files with 14 additions and 8 deletions
|
@ -60,6 +60,8 @@ delete-exitfunc= 1
|
||||||
width= 80
|
width= 80
|
||||||
height= 40
|
height= 40
|
||||||
font= TkFixedFont
|
font= TkFixedFont
|
||||||
|
# For TkFixedFont, the actual size and boldness are obtained from tk
|
||||||
|
# and override 10 and 0. See idlelib.config.IdleConf.GetFont
|
||||||
font-size= 10
|
font-size= 10
|
||||||
font-bold= 0
|
font-bold= 0
|
||||||
encoding= none
|
encoding= none
|
||||||
|
|
|
@ -54,25 +54,29 @@ class FontTabTest(unittest.TestCase):
|
||||||
changes.clear()
|
changes.clear()
|
||||||
|
|
||||||
def test_font(self):
|
def test_font(self):
|
||||||
|
# Set values guaranteed not to be defaults.
|
||||||
|
dfont = idleConf.GetFont(root, 'main', 'EditorWindow')
|
||||||
|
dsize = str(dfont[1])
|
||||||
|
dbold = dfont[2] == 'bold'
|
||||||
configure.fontName.set('Test Font')
|
configure.fontName.set('Test Font')
|
||||||
expected = [
|
expected = [
|
||||||
('main', 'EditorWindow', 'font', 'Test Font'),
|
('main', 'EditorWindow', 'font', 'Test Font'),
|
||||||
('main', 'EditorWindow', 'font-size', '10'),
|
('main', 'EditorWindow', 'font-size', dsize),
|
||||||
('main', 'EditorWindow', 'font-bold', False)]
|
('main', 'EditorWindow', 'font-bold', dbold)]
|
||||||
self.assertEqual(changes, expected)
|
self.assertEqual(changes, expected)
|
||||||
changes.clear()
|
changes.clear()
|
||||||
configure.fontSize.set(12)
|
configure.fontSize.set(20)
|
||||||
expected = [
|
expected = [
|
||||||
('main', 'EditorWindow', 'font', 'Test Font'),
|
('main', 'EditorWindow', 'font', 'Test Font'),
|
||||||
('main', 'EditorWindow', 'font-size', '12'),
|
('main', 'EditorWindow', 'font-size', '20'),
|
||||||
('main', 'EditorWindow', 'font-bold', False)]
|
('main', 'EditorWindow', 'font-bold', dbold)]
|
||||||
self.assertEqual(changes, expected)
|
self.assertEqual(changes, expected)
|
||||||
changes.clear()
|
changes.clear()
|
||||||
configure.fontBold.set(True)
|
configure.fontBold.set(not dbold)
|
||||||
expected = [
|
expected = [
|
||||||
('main', 'EditorWindow', 'font', 'Test Font'),
|
('main', 'EditorWindow', 'font', 'Test Font'),
|
||||||
('main', 'EditorWindow', 'font-size', '12'),
|
('main', 'EditorWindow', 'font-size', '20'),
|
||||||
('main', 'EditorWindow', 'font-bold', True)]
|
('main', 'EditorWindow', 'font-bold', not dbold)]
|
||||||
self.assertEqual(changes, expected)
|
self.assertEqual(changes, expected)
|
||||||
|
|
||||||
#def test_sample(self): pass # TODO
|
#def test_sample(self): pass # TODO
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue