1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-28 19:01:58 +00:00

fix byte range error in test, fixes #1740

This commit is contained in:
Thomas Waldmann 2016-10-19 17:38:30 +02:00
parent 64d128cf22
commit e02d1a66b8

View file

@ -155,7 +155,7 @@ def test_passphrase(self, keys_dir, monkeypatch):
def _corrupt_byte(self, key, data, offset):
data = bytearray(data)
data[offset] += 1
data[offset] ^= 1
with pytest.raises(IntegrityError):
key.decrypt(b'', data)
@ -186,7 +186,7 @@ def test_assert_id(self, key):
id = key.id_hash(plaintext)
key.assert_id(id, plaintext)
id_changed = bytearray(id)
id_changed[0] += 1
id_changed[0] ^= 1
with pytest.raises(IntegrityError):
key.assert_id(id_changed, plaintext)
plaintext_changed = plaintext + b'1'