(self)
| 29 | @unittest.expectedFailure # TODO: RUSTPYTHON; + 9e43ee3929471739680c0e705482b4ae1c4122e4 |
| 30 | @requires_resource('cpu') |
| 31 | def test_method_checksum(self): |
| 32 | h = hashlib.sha1() |
| 33 | for i in range(sys.maxunicode + 1): |
| 34 | char = chr(i) |
| 35 | data = [ |
| 36 | # Predicates (single char) |
| 37 | "01"[char.isalnum()], |
| 38 | "01"[char.isalpha()], |
| 39 | "01"[char.isdecimal()], |
| 40 | "01"[char.isdigit()], |
| 41 | "01"[char.islower()], |
| 42 | "01"[char.isnumeric()], |
| 43 | "01"[char.isspace()], |
| 44 | "01"[char.istitle()], |
| 45 | "01"[char.isupper()], |
| 46 | |
| 47 | # Predicates (multiple chars) |
| 48 | "01"[(char + 'abc').isalnum()], |
| 49 | "01"[(char + 'abc').isalpha()], |
| 50 | "01"[(char + '123').isdecimal()], |
| 51 | "01"[(char + '123').isdigit()], |
| 52 | "01"[(char + 'abc').islower()], |
| 53 | "01"[(char + '123').isnumeric()], |
| 54 | "01"[(char + ' \t').isspace()], |
| 55 | "01"[(char + 'abc').istitle()], |
| 56 | "01"[(char + 'ABC').isupper()], |
| 57 | |
| 58 | # Mappings (single char) |
| 59 | char.lower(), |
| 60 | char.upper(), |
| 61 | char.title(), |
| 62 | |
| 63 | # Mappings (multiple chars) |
| 64 | (char + 'abc').lower(), |
| 65 | (char + 'ABC').upper(), |
| 66 | (char + 'abc').title(), |
| 67 | (char + 'ABC').title(), |
| 68 | |
| 69 | ] |
| 70 | h.update(''.join(data).encode('utf-8', 'surrogatepass')) |
| 71 | result = h.hexdigest() |
| 72 | self.assertEqual(result, self.expectedchecksum) |
| 73 | |
| 74 | class UnicodeDatabaseTest(unittest.TestCase): |
| 75 | db = unicodedata |
nothing calls this directly
no test coverage detected