Download tests/test_validation.py from nvidia/aisim-data: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/datasets/nvidia/aisim-data/resolve/refs%2Fpr%2F1/tests/test_validation.py
- Command line
-
hf download hf://datasets/nvidia/aisim-data@refs/pr/1/tests/test_validation.py
-
curl -L -o test_validation.py https://huggingface.co/datasets/nvidia/aisim-data/resolve/refs%2Fpr%2F1/tests/test_validation.py
1.31 kB
| from pathlib import Path | |
| import yaml | |
| from scripts.validate import DATA, schema_validator, validate, validate_manifest | |
| FIXTURES = Path(__file__).parent / "fixtures" | |
| def test_repository_data_is_valid(): | |
| assert validate() == [] | |
| def test_unknown_manifest_field_is_rejected(tmp_path: Path): | |
| document = yaml.safe_load((FIXTURES / "invalid-e2e-manifest.yaml").read_text()) | |
| errors = list(schema_validator("e2e").iter_errors(document)) | |
| assert errors | |
| def test_valid_fixture_matches_schema(): | |
| document = yaml.safe_load((FIXTURES / "valid-e2e-manifest.yaml").read_text()) | |
| assert list(schema_validator("e2e").iter_errors(document)) == [] | |
| def test_path_identity_is_enforced(tmp_path: Path): | |
| source = next(DATA.glob("e2e/**/manifest.yaml")) | |
| target = DATA / "e2e/deepseek-ai--DeepSeek-V4-Pro/H100/vllm/0.25.1/tp8/manifest.yaml" | |
| target.parent.mkdir(parents=True, exist_ok=True) | |
| target.write_bytes(source.read_bytes()) | |
| try: | |
| assert any("path identity" in error for error in validate_manifest(target)) | |
| finally: | |
| target.unlink() | |
| for parent in [target.parent, target.parent.parent, target.parent.parent.parent, target.parent.parent.parent.parent]: | |
| try: | |
| parent.rmdir() | |
| except OSError: | |
| break | |