1
0
Fork 0
mirror of synced 2024-12-13 02:45:45 -05:00

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

View file

@ -319,6 +319,24 @@ def test_asymmetric_encrypt(
assert 'Enter the user ID' in run.out 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.usefixtures('asymmetric_key')
@pytest.mark.parametrize( @pytest.mark.parametrize(
'key_exists', [True, False], 'key_exists', [True, False],