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

Function read_vectors

Lib/test/test_hashlib.py:82–95  ·  view source on GitHub ↗
(hash_name)

Source from the content-addressed store, hash-verified

80URL = "http://www.pythontest.net/hashlib/{}.txt"
81
82def read_vectors(hash_name):
83 url = URL.format(hash_name)
84 try:
85 testdata = support.open_urlresource(url, encoding="utf-8")
86 except (OSError, HTTPException):
87 raise unittest.SkipTest("Could not retrieve {}".format(url))
88 with testdata:
89 for line in testdata:
90 line = line.strip()
91 if line.startswith('#') or not line:
92 continue
93 parts = line.split(',')
94 parts[0] = bytes.fromhex(parts[0])
95 yield parts
96
97
98class HashLibTestCase(unittest.TestCase):

Calls 5

formatMethod · 0.45
stripMethod · 0.45
startswithMethod · 0.45
splitMethod · 0.45
fromhexMethod · 0.45

Tested by

no test coverage detected