Add test for multiple recipients

This commit is contained in:
Tim Byrne 2020-01-15 08:44:35 -06:00
parent 83c0edd9fb
commit 75d2747aa0
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
1 changed files with 18 additions and 0 deletions

View File

@ -319,6 +319,24 @@ def test_asymmetric_encrypt(
assert 'Enter the user ID' in run.out
@pytest.mark.usefixtures('asymmetric_key')
@pytest.mark.usefixtures('encrypt_targets')
def test_multi_key(runner, yadm_y, gnupg):
"""Test multiple recipients"""
# specify two encryption recipient
os.system(' '.join(yadm_y(
'config', 'yadm.gpg-recipient', f'"{KEY_NAME} second-key"')))
env = os.environ.copy()
env['GNUPGHOME'] = gnupg.home
run = runner(yadm_y('encrypt'), env=env)
assert run.failure
assert 'second-key: skipped: No public key' in run.err
@pytest.mark.usefixtures('asymmetric_key')
@pytest.mark.parametrize(
'key_exists', [True, False],