mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-06-24 22:29:56 +02:00
27 lines
900 B
Python
27 lines
900 B
Python
import pytest
|
|
from datasets import load_dataset
|
|
|
|
from agentic_security.probe_data import REGISTRY
|
|
|
|
|
|
@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)}")
|