import unittest from app.core.config import settings from app.services.ops_service import _recommend_driver_execution_mode_for_supported_modes class OpsServiceExecutionModeRecommendationTests(unittest.TestCase): def test_recommend_driver_execution_mode_prefers_local_runtime_for_current_node(self) -> None: result = _recommend_driver_execution_mode_for_supported_modes( [settings.node_code], supported_modes=["remote-agent", "local-runtime", "ssh"], default_mode="remote-agent", ) self.assertEqual("local-runtime", result["execution_mode"]) self.assertIn("local-runtime", result["reason"]) self.assertEqual( ["remote-agent", "local-runtime", "ssh"], result["supported_modes"], ) if __name__ == "__main__": unittest.main()