You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
817 B
26 lines
817 B
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)
|
|
|