(string, length=64)
| 131 | "Couldn't interpret %r as hexadecimal; raised: %s" % (string, e)) |
| 132 | |
| 133 | def assert_is_hash_string(string, length=64): |
| 134 | if not isinstance(string, str): |
| 135 | raise AssertionError("Expected a string, got type %r" % type(string)) |
| 136 | elif length and len(string) != length: |
| 137 | raise AssertionError( |
| 138 | "String of length %d expected; got %d" % (length, len(string))) |
| 139 | elif not re.match('[abcdef0-9]+$', string): |
| 140 | raise AssertionError( |
| 141 | "String %r contains invalid characters for a hash." % string) |
| 142 | |
| 143 | def assert_array_result(object_array, to_match, expected, should_not_find=False): |
| 144 | """ |
no test coverage detected