diff options
| author | J08nY | 2023-04-21 15:10:56 +0200 |
|---|---|---|
| committer | J08nY | 2023-04-21 15:10:56 +0200 |
| commit | 5893352a41ce8e513dfbbb7c3e35cac3925966ea (patch) | |
| tree | 64b799f85667ead123c6bbada1db8fc1ed585f5d /tests/fips/test_fips_algorithm_dataset.py | |
| parent | 3728142d5fa9ec991b00cf16e9a04384b82f65d6 (diff) | |
| download | sec-certs-5893352a41ce8e513dfbbb7c3e35cac3925966ea.tar.gz sec-certs-5893352a41ce8e513dfbbb7c3e35cac3925966ea.tar.zst sec-certs-5893352a41ce8e513dfbbb7c3e35cac3925966ea.zip | |
Revert "Move FIPS test fixtures to conftest and share them."
This reverts commit 98c4f06c6ced66beab6f0c576542acbf15212416.
Diffstat (limited to 'tests/fips/test_fips_algorithm_dataset.py')
| -rw-r--r-- | tests/fips/test_fips_algorithm_dataset.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/fips/test_fips_algorithm_dataset.py b/tests/fips/test_fips_algorithm_dataset.py index 137ac575..1d45e67c 100644 --- a/tests/fips/test_fips_algorithm_dataset.py +++ b/tests/fips/test_fips_algorithm_dataset.py @@ -1,8 +1,10 @@ from __future__ import annotations +from pathlib import Path from typing import Any import pytest +import tests.data.fips.dataset from sec_certs.dataset.fips_algorithm import FIPSAlgorithmDataset from sec_certs.sample.fips_algorithm import FIPSAlgorithm @@ -20,6 +22,27 @@ def test_alg_dset_from_web(tmp_path): assert len(dset) > 30000 +@pytest.fixture(scope="module") +def alg_dset_path() -> Path: + return Path(tests.data.fips.dataset.__path__[0]) / "alg_dataset.json" + + +@pytest.fixture(scope="module") +def alg_dset(alg_dset_path: Path) -> FIPSAlgorithmDataset: + return FIPSAlgorithmDataset.from_json(alg_dset_path) + + +@pytest.fixture(scope="module") +def alg_dict() -> dict[str, Any]: + return { + "alg_number": "2902", + "algorithm_type": "AES", + "vendor": "Hewlett-Packard Development Company, L.P.", + "implementation_name": "HP Secure Encryption Engine v1.0", + "validation_date": "7/10/2014", + } + + def test_alg_dset_lookup_dict(alg_dset: FIPSAlgorithmDataset): alg = alg_dset["AES2902"] assert alg_dset.alg_number_to_algs["2902"] == {alg} |
