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