]> granicus.if.org Git - python/commitdiff
bpo-30310: Add a test for non-ascii font family. (#1567) (#1832)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 27 May 2017 14:01:31 +0000 (17:01 +0300)
committerGitHub <noreply@github.com>
Sat, 27 May 2017 14:01:31 +0000 (17:01 +0300)
Lib/tkinter/test/test_tkinter/test_font.py

index c094c61ce42a067b32d661248f5baf719e9099a3..97cd87ccdc81dd1da3bfc65acb9f63b070b49c97 100644 (file)
@@ -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),