diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-05-27 14:01:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-27 14:01:31 (GMT) |
commit | a92adf8f0782a1ccdc68942767bdb357a9281b30 (patch) | |
tree | 5ad6a375b141cfd9914ebcffc36368dfc86e8363 /Lib/tkinter | |
parent | 12d6b5d156377c0877931a03ef2439dccb2f3711 (diff) | |
download | cpython-a92adf8f0782a1ccdc68942767bdb357a9281b30.zip cpython-a92adf8f0782a1ccdc68942767bdb357a9281b30.tar.gz cpython-a92adf8f0782a1ccdc68942767bdb357a9281b30.tar.bz2 |
bpo-30310: Add a test for non-ascii font family. (#1567) (#1832)
Diffstat (limited to 'Lib/tkinter')
-rw-r--r-- | Lib/tkinter/test/test_tkinter/test_font.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/tkinter/test/test_tkinter/test_font.py b/Lib/tkinter/test/test_tkinter/test_font.py index c094c61..97cd87c 100644 --- a/Lib/tkinter/test/test_tkinter/test_font.py +++ b/Lib/tkinter/test/test_tkinter/test_font.py @@ -1,7 +1,7 @@ import unittest import tkinter from tkinter import font -from test.support import requires, run_unittest +from test.support import requires, run_unittest, gc_collect from tkinter.test.support import AbstractTkTest requires('gui') @@ -35,6 +35,16 @@ class FontTest(AbstractTkTest, unittest.TestCase): self.assertIsInstance(self.font.cget(key), sizetype) self.assertIsInstance(self.font[key], sizetype) + def test_unicode_family(self): + family = 'MS \u30b4\u30b7\u30c3\u30af' + try: + f = font.Font(root=self.root, family=family, exists=True) + except tkinter.TclError: + f = font.Font(root=self.root, family=family, exists=False) + self.assertEqual(f.cget('family'), family) + del f + gc_collect() + def test_actual(self): options = self.font.actual() self.assertGreaterEqual(set(options), |