Skip to content

Commit

Permalink
fixup! add vault pki utils tests
Browse files Browse the repository at this point in the history
  • Loading branch information
voyvodov committed May 13, 2024
1 parent 48b8e7d commit 550d0d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/unit/modules/test_vault_pki.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest
from salt.exceptions import CommandExecutionError
from salt.exceptions import SaltInvocationError

import saltext.vault.utils.vault as vaultutil
from saltext.vault.modules import vault_pki
Expand Down Expand Up @@ -193,16 +194,16 @@ def test_generate_root_payload(query, common_name, root_type, args):


def test_generate_root_raise_err_with_default_name():
with pytest.raises(CommandExecutionError):
with pytest.raises(SaltInvocationError):
vault_pki.generate_root("my root", issuer_name="default")

with pytest.raises(CommandExecutionError):
with pytest.raises(SaltInvocationError):
vault_pki.generate_root("my root", key_name="default")


@pytest.mark.parametrize(
"args", [{"serial": "00:11:22:33:44:55", "certificate": "-----BEGIN CERTIFICATE..."}, {}]
)
def test_revoke_certificate_raise_err(args):
with pytest.raises(CommandExecutionError):
with pytest.raises(SaltInvocationError):
vault_pki.revoke_certificate(**args)

0 comments on commit 550d0d8

Please sign in to comment.