Download BrowserGym/tests/core/test_actions_python.py from LangAGI-Lab/Web-Shepherd-Demo: direct link, hf CLI and curl.
- Browser
- Download file 676 Bytes
-
https://huggingface.co/spaces/LangAGI-Lab/Web-Shepherd-Demo/resolve/main/BrowserGym/tests/core/test_actions_python.py
- Command line
-
hf download hf://spaces/LangAGI-Lab/Web-Shepherd-Demo/BrowserGym/tests/core/test_actions_python.py
-
curl -L -o test_actions_python.py https://huggingface.co/spaces/LangAGI-Lab/Web-Shepherd-Demo/resolve/main/BrowserGym/tests/core/test_actions_python.py
676 Bytes
| import pytest | |
| from browsergym.core.action.python import PythonActionSet | |
| ACTIONS_TO_TEST = [ | |
| ( | |
| """\ | |
| a = 0 | |
| """, | |
| """\ | |
| a = 0 | |
| """, | |
| ), | |
| ( | |
| """\ | |
| ``` | |
| a = 0 | |
| ``` | |
| """, | |
| """\ | |
| a = 0 | |
| """, | |
| ), | |
| ( | |
| """\ | |
| ```python | |
| a = 0 | |
| ``` | |
| """, | |
| """\ | |
| a = 0 | |
| """, | |
| ), | |
| ( | |
| """\ | |
| ```python | |
| a = 0 | |
| ``` | |
| This is an explanation | |
| ```python | |
| b = 3 | |
| ``` | |
| More explanations | |
| """, | |
| """\ | |
| a = 0 | |
| b = 3 | |
| """, | |
| ), | |
| ] | |
| def test_action_cleaning(action, expected_code): | |
| action_set = PythonActionSet() | |
| code = action_set.to_python_code(action) | |
| assert code == expected_code | |