from __future__ import annotations

import importlib.util
import sys
from pathlib import Path

HERE = Path(__file__).parent
SPEC = importlib.util.spec_from_file_location(
    "observer_v61_binding", HERE / "observer_v61.py"
)
assert SPEC and SPEC.loader
m = importlib.util.module_from_spec(SPEC)
sys.modules[SPEC.name] = m
SPEC.loader.exec_module(m)


def test_candidate_manifests_wheels_and_installed_module_parity() -> None:
    m.verify_binding()
    assert m.verify_profile_wheel_parity() == 44


def test_wrapper_binds_v61_to_current_candidate_and_preserved_hermes() -> None:
    observer = m.load_observer()
    assert observer.SUCCESSOR == m.SUCCESSOR
    assert observer.CORE == m.CORE
    assert observer.WHEEL == m.HERMES_WHEEL
    assert observer.PROFILE_WHEEL == m.PROFILE_WHEEL
    assert observer.SITE == m.INSTALLED
