import os
import importlib


def test_entry_sets_legacy_onnx_flag_on_import(monkeypatch):
    monkeypatch.delenv("ANON_SKIP_LEGACY_ONNX_MANAGER", raising=False)
    import Pseudonymisation_Gui_V6 as entry
    importlib.reload(entry)
    assert os.environ.get("ANON_SKIP_LEGACY_ONNX_MANAGER") == "1"


def test_entry_does_not_override_explicit_flag(monkeypatch):
    monkeypatch.setenv("ANON_SKIP_LEGACY_ONNX_MANAGER", "0")
    import Pseudonymisation_Gui_V6 as entry
    importlib.reload(entry)
    assert os.environ.get("ANON_SKIP_LEGACY_ONNX_MANAGER") == "0"
