import os

import importlib


def test_get_debug_trajectories_enabled_various_values():
    # Import under test
    import explorer

    # Ensure default (unset) is False
    os.environ.pop("EXPLORER_DEBUG_TRAJECTORIES", None)
    assert explorer.get_debug_trajectories_enabled() is False

    # Truthy values
    for val in ("1", "true", "True"):
        os.environ["EXPLORER_DEBUG_TRAJECTORIES"] = val
        # reload not required as function reads env at call time
        assert explorer.get_debug_trajectories_enabled() is True

    # Falsy / unexpected values
    for val in ("0", "false", "False", "yes", "random"):
        os.environ["EXPLORER_DEBUG_TRAJECTORIES"] = val
        assert explorer.get_debug_trajectories_enabled() is False

    # Cleanup
    os.environ.pop("EXPLORER_DEBUG_TRAJECTORIES", None)
