keep-it-secret/tests/ext/vault/conftest.py
2025-10-24 11:12:23 +00:00

32 lines
658 B
Python

# -*- coding: utf-8 -*-
# type: ignore
from __future__ import annotations
from unittest import mock
import hvac
import pytest
from pytest_mock import MockerFixture
from .fixtures import TestingVaultSecrets
@pytest.fixture
def hvac_client() -> mock.Mock:
return mock.Mock(spec=hvac.Client)
@pytest.fixture
def mock_hvac_client(mocker: MockerFixture,
hvac_client: mock.Mock,
) -> mock.Mock:
return mocker.patch(
'keep_it_secret.ext.vault.hvac.Client',
return_value=hvac_client,
)
@pytest.fixture
def testing_vault_secrets() -> TestingVaultSecrets:
return TestingVaultSecrets()