(enh) add test_python_version to test_bash.py runtime tests (#4098)

This commit is contained in:
tobitege 2024-09-28 02:21:14 +02:00 committed by GitHub
parent 2bed3a424c
commit 575a829d94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -456,3 +456,17 @@ def test_git_operation(box_class):
assert obs.exit_code == 0
finally:
_close_test_runtime(runtime)
def test_python_version(temp_dir, box_class, run_as_openhands):
runtime = _load_runtime(temp_dir, box_class, run_as_openhands)
try:
obs = runtime.run_action(CmdRunAction(command='python --version'))
assert isinstance(
obs, CmdOutputObservation
), 'The observation should be a CmdOutputObservation.'
assert obs.exit_code == 0, 'The exit code should be 0.'
assert 'Python 3' in obs.content, 'The output should contain "Python 3".'
finally:
_close_test_runtime(runtime)