mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-06-23 21:59:57 +02:00
feat(add test_registry_accessibility):
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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")
|
||||
|
||||
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)}")
|
||||
Reference in New Issue
Block a user