Files
agentic_security/tests/test_registry.py
T
2025-08-10 14:33:25 +05:30

27 lines
900 B
Python

import pytest
from agentic_security.probe_data import REGISTRY
from datasets import load_dataset
@pytest.mark.slow
@pytest.mark.parametrize("dataset", REGISTRY)
def test_registry_accessibility(dataset):
source = dataset.get("source", "")
if "hugging" not in source.lower():
return pytest.skip("skipped dataset")
if not dataset.get("is_active"):
return pytest.skip("skipped dataset")
dataset_name = dataset.get("dataset_name")
if not dataset_name:
pytest.fail(f"No dataset_name found in {dataset}")
# Load only metadata (no data download)
try:
ds = load_dataset(dataset_name, split=None)
# Check if metadata is accessible without loading full data
assert ds is not None, f"Failed to load metadata for {dataset_name}"
except Exception as e:
pytest.fail(f"Error loading metadata for {dataset_name}: {str(e)}")