Island: Add new locking test for RepositoryEncryptor

This commit is contained in:
Mike Salvatore 2022-07-15 07:52:36 -04:00
parent 3c4883b304
commit 52f5e70812
1 changed files with 14 additions and 0 deletions

View File

@ -59,6 +59,20 @@ def test_existing_key_reused(encryptor, key_file):
assert key_file_hash_1 == key_file_hash_2
def test_existing_key_reused__lock(encryptor, key_file):
assert not key_file.is_file()
encryptor.unlock(SECRET)
key_file_hash_1 = get_file_sha256_hash(key_file)
encryptor.lock()
encryptor.unlock(SECRET)
key_file_hash_2 = get_file_sha256_hash(key_file)
assert key_file_hash_1 == key_file_hash_2
def test_unlock_os_error(encryptor, key_file):
key_file.mkdir()