def test_parse_invalid(self): with pytest.raises(ValueError): DigestValue.parse('asdf', hashlib.md5)
def test_parse(self): val = DigestValue(b'salt', b'digest', hashlib.sha256) val2 = DigestValue.parse(str(val), hashlib.sha256) assert val == val2