Spaces:
No application file
No application file
Sandeep Suresh
feat: Implement wait action and enhance action handling in simulation environment
dfc56a2 Download tests/test_inference.py from SandyTheAdventurer/openenv: direct link, hf CLI and curl.
- Browser
- Download file 665 Bytes
-
https://huggingface.co/spaces/SandyTheAdventurer/openenv/resolve/main/tests/test_inference.py
- Command line
-
hf download hf://spaces/SandyTheAdventurer/openenv/tests/test_inference.py
-
curl -L -o test_inference.py https://huggingface.co/spaces/SandyTheAdventurer/openenv/resolve/main/tests/test_inference.py
665 Bytes
| from inference import _normalize_action | |
| def test_normalize_action_maps_set_hpas_to_set_hpa(): | |
| action = _normalize_action({"action_type": "set_hpas", "deployment": "backend"}) | |
| assert action["action_type"] == "set_hpa" | |
| assert action["deployment"] == "backend" | |
| assert action["min_replicas"] == 2 | |
| assert action["max_replicas"] == 6 | |
| assert action["cpu_target_percent"] == 70 | |
| def test_normalize_action_non_string_type_defaults_to_describe(): | |
| action = _normalize_action({"action_type": ["set_hpa"]}) | |
| assert action["action_type"] == "describe" | |
| assert action["resource_type"] == "deployment" | |
| assert action["name"] == "frontend" | |