Files
vmware-api-simulator/tests/unit/test_api_viewer_fixture.py
inecs f8d3cbdd59 Initial commit: VMware vSphere API simulator scaffold.
Add the FastAPI app, PostgreSQL migrations, Docker/Helm packaging, API
contracts, docs, client examples, and the unit/integration/compatibility
test suite for local client and tooling labs without a real vCenter.
2026-07-18 04:42:11 +03:00

26 lines
807 B
Python

"""Offline checks for the researched API Viewer sample."""
import hashlib
import json
from pathlib import Path
from typing import Any, cast
import pytest
pytestmark = pytest.mark.pve_stub
FIXTURES = Path(__file__).parents[1] / "fixtures" / "api-viewer"
def test_version_fixture_matches_provenance() -> None:
fixture_path = FIXTURES / "pve-9.2.3-version.json"
provenance_path = FIXTURES / "pve-9.2.3-version.provenance.json"
fixture_bytes = fixture_path.read_bytes()
fixture = cast(dict[str, Any], json.loads(fixture_bytes))
provenance = cast(dict[str, Any], json.loads(provenance_path.read_bytes()))
assert fixture["path"] == "/version"
assert fixture["info"]["GET"]["method"] == "GET"
assert hashlib.sha256(fixture_bytes).hexdigest() == provenance["fixture_sha256"]