(hash_name)
| 80 | URL = "http://www.pythontest.net/hashlib/{}.txt" |
| 81 | |
| 82 | def 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 | |
| 98 | class HashLibTestCase(unittest.TestCase): |
no test coverage detected