summaryrefslogtreecommitdiff
path: root/Lib/idlelib/idle_test
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-11-07 23:14:53 -0500
committerTerry Jan Reedy <tjreedy@udel.edu>2016-11-07 23:14:53 -0500
commitb393c30c0542243056f5dd531b0d2a72ba3c77aa (patch)
tree59e667ccbe3824836d0c71401aafee2d5590af4c /Lib/idlelib/idle_test
parent9aa846bcab8dcb0dac2782ad45fc42b810683b44 (diff)
downloadcpython-b393c30c0542243056f5dd531b0d2a72ba3c77aa.tar.gz
Issue #28572: Use system-specific values for configdialog font test
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r--Lib/idlelib/idle_test/test_configdialog.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py
index 81c57e863e..3f94493733 100644
--- a/Lib/idlelib/idle_test/test_configdialog.py
+++ b/Lib/idlelib/idle_test/test_configdialog.py
@@ -54,25 +54,29 @@ class FontTabTest(unittest.TestCase):
changes.clear()
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')
expected = [
('main', 'EditorWindow', 'font', 'Test Font'),
- ('main', 'EditorWindow', 'font-size', '10'),
- ('main', 'EditorWindow', 'font-bold', False)]
+ ('main', 'EditorWindow', 'font-size', dsize),
+ ('main', 'EditorWindow', 'font-bold', dbold)]
self.assertEqual(changes, expected)
changes.clear()
- configure.fontSize.set(12)
+ configure.fontSize.set(20)
expected = [
('main', 'EditorWindow', 'font', 'Test Font'),
- ('main', 'EditorWindow', 'font-size', '12'),
- ('main', 'EditorWindow', 'font-bold', False)]
+ ('main', 'EditorWindow', 'font-size', '20'),
+ ('main', 'EditorWindow', 'font-bold', dbold)]
self.assertEqual(changes, expected)
changes.clear()
- configure.fontBold.set(True)
+ configure.fontBold.set(not dbold)
expected = [
('main', 'EditorWindow', 'font', 'Test Font'),
- ('main', 'EditorWindow', 'font-size', '12'),
- ('main', 'EditorWindow', 'font-bold', True)]
+ ('main', 'EditorWindow', 'font-size', '20'),
+ ('main', 'EditorWindow', 'font-bold', not dbold)]
self.assertEqual(changes, expected)
#def test_sample(self): pass # TODO