Download tests/test_env_api.py from NeerjaK/OnCallEnv: direct link, hf CLI and curl.
- Browser
- Download file 546 Bytes
-
https://huggingface.co/spaces/NeerjaK/OnCallEnv/resolve/main/tests/test_env_api.py
- Command line
-
hf download hf://spaces/NeerjaK/OnCallEnv/tests/test_env_api.py
-
curl -L -o test_env_api.py https://huggingface.co/spaces/NeerjaK/OnCallEnv/resolve/main/tests/test_env_api.py
546 Bytes
| from oncallenv import OnCallRedShiftEnv | |
| from oncallenv.core.types import Action, Observation, State | |
| def test_gym_style_api_contract(): | |
| env = OnCallRedShiftEnv() | |
| obs = env.reset(task_id="seed_easy_memory_leak") | |
| assert isinstance(obs, Observation) | |
| assert "kubectl_logs" in obs.available_tools | |
| obs = env.step(Action(command="kubectl_get_pods")) | |
| assert isinstance(obs, Observation) | |
| state = env.state | |
| assert isinstance(state, State) | |
| assert state.step_count == 1 | |
| env.close() | |
| assert env.state.done is True | |