LEFT | RIGHT |
(no file at all) | |
1 """ Test script for the Unicode implementation. | 1 """ Test script for the Unicode implementation. |
2 | 2 |
3 Written by Marc-Andre Lemburg (mal@lemburg.com). | 3 Written by Marc-Andre Lemburg (mal@lemburg.com). |
4 | 4 |
5 (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. | 5 (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. |
6 | 6 |
7 """ | 7 """ |
8 import _string | 8 import _string |
9 import codecs | 9 import codecs |
10 import itertools | 10 import itertools |
(...skipping 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2406 self.assertTrue(astral < astral2) | 2406 self.assertTrue(astral < astral2) |
2407 self.assertTrue(astral >= ascii) | 2407 self.assertTrue(astral >= ascii) |
2408 self.assertTrue(astral >= latin) | 2408 self.assertTrue(astral >= latin) |
2409 self.assertTrue(astral >= bmp2) | 2409 self.assertTrue(astral >= bmp2) |
2410 self.assertFalse(astral >= astral2) | 2410 self.assertFalse(astral >= astral2) |
2411 | 2411 |
2412 def test_free_after_iterating(self): | 2412 def test_free_after_iterating(self): |
2413 support.check_free_after_iterating(self, iter, str) | 2413 support.check_free_after_iterating(self, iter, str) |
2414 support.check_free_after_iterating(self, reversed, str) | 2414 support.check_free_after_iterating(self, reversed, str) |
2415 | 2415 |
2416 def test_invalid_sequences(self): | |
2417 for letter in string.ascii_letters + "89": # 0-7 are octal escapes | |
2418 if letter in "abfnrtuvxNU": | |
2419 continue | |
2420 with self.assertWarns(DeprecationWarning): | |
2421 eval(r"'\%s'" % letter) | |
2422 | |
2423 | 2416 |
2424 class CAPITest(unittest.TestCase): | 2417 class CAPITest(unittest.TestCase): |
2425 | 2418 |
2426 # Test PyUnicode_FromFormat() | 2419 # Test PyUnicode_FromFormat() |
2427 def test_from_format(self): | 2420 def test_from_format(self): |
2428 support.import_module('ctypes') | 2421 support.import_module('ctypes') |
2429 from ctypes import ( | 2422 from ctypes import ( |
2430 pythonapi, py_object, sizeof, | 2423 pythonapi, py_object, sizeof, |
2431 c_int, c_long, c_longlong, c_ssize_t, | 2424 c_int, c_long, c_longlong, c_ssize_t, |
2432 c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p) | 2425 c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p) |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2869 "obj", | 2862 "obj", |
2870 [(True, 'arg'), | 2863 [(True, 'arg'), |
2871 (False, 'key1'), | 2864 (False, 'key1'), |
2872 (False, 'key2'), | 2865 (False, 'key2'), |
2873 ]]) | 2866 ]]) |
2874 self.assertRaises(TypeError, _string.formatter_field_name_split, 1) | 2867 self.assertRaises(TypeError, _string.formatter_field_name_split, 1) |
2875 | 2868 |
2876 | 2869 |
2877 if __name__ == "__main__": | 2870 if __name__ == "__main__": |
2878 unittest.main() | 2871 unittest.main() |
LEFT | RIGHT |