MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_method_checksum

Method test_method_checksum

Lib/test/test_unicodedata.py:31–72  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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
74class UnicodeDatabaseTest(unittest.TestCase):
75 db = unicodedata

Callers

nothing calls this directly

Calls 15

chrFunction · 0.85
sha1Method · 0.45
isalnumMethod · 0.45
isalphaMethod · 0.45
isdecimalMethod · 0.45
isdigitMethod · 0.45
islowerMethod · 0.45
isnumericMethod · 0.45
isspaceMethod · 0.45
istitleMethod · 0.45
isupperMethod · 0.45
lowerMethod · 0.45

Tested by

no test coverage detected