فهرست منبع

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

tobitege 1 سال پیش
والد
کامیت
575a829d94
1فایلهای تغییر یافته به همراه14 افزوده شده و 0 حذف شده
  1. 14 0
      tests/runtime/test_bash.py

+ 14 - 0
tests/runtime/test_bash.py

@@ -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)