ยปCore Development>Code coverage>Lib/idlelib/idle_test/test_editor.py

Python code coverage for Lib/idlelib/idle_test/test_editor.py

#countcontent
1n/aimport unittest
2n/afrom tkinter import Tk, Text
3n/afrom idlelib.editor import EditorWindow
4n/afrom test.support import requires
5n/a
6n/aclass Editor_func_test(unittest.TestCase):
7n/a def test_filename_to_unicode(self):
8n/a func = EditorWindow._filename_to_unicode
9n/a class dummy(): filesystemencoding = 'utf-8'
10n/a pairs = (('abc', 'abc'), ('a\U00011111c', 'a\ufffdc'),
11n/a (b'abc', 'abc'), (b'a\xf0\x91\x84\x91c', 'a\ufffdc'))
12n/a for inp, out in pairs:
13n/a self.assertEqual(func(dummy, inp), out)
14n/a
15n/aif __name__ == '__main__':
16n/a unittest.main(verbosity=2)