Spaces:
Configuration error
Configuration error
Download tests/unit/test_command_success.py from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 863 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/tests/unit/test_command_success.py
- Command line
-
hf download hf://spaces/flyingdarkdev/README/tests/unit/test_command_success.py
-
curl -L -o test_command_success.py https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/tests/unit/test_command_success.py
863 Bytes
| from openhands.events.observation.commands import ( | |
| CmdOutputMetadata, | |
| CmdOutputObservation, | |
| IPythonRunCellObservation, | |
| ) | |
| def test_cmd_output_success(): | |
| # Test successful command | |
| obs = CmdOutputObservation( | |
| command='ls', | |
| content='file1.txt\nfile2.txt', | |
| metadata=CmdOutputMetadata(exit_code=0), | |
| ) | |
| assert obs.success is True | |
| assert obs.error is False | |
| # Test failed command | |
| obs = CmdOutputObservation( | |
| command='ls', | |
| content='No such file or directory', | |
| metadata=CmdOutputMetadata(exit_code=1), | |
| ) | |
| assert obs.success is False | |
| assert obs.error is True | |
| def test_ipython_cell_success(): | |
| # IPython cells are always successful | |
| obs = IPythonRunCellObservation(code='print("Hello")', content='Hello') | |
| assert obs.success is True | |
| assert obs.error is False | |