π OpenHands: AI-Driven Development
Add a sanity test for load_app_config and get_agent_config_arg (#6723)
Boxuan Liefbff2e655f9
diff --git a/tests/unit/test_config.py b/tests/unit/test_config.pyindex 7aab02c0e0..10f09447ba 100644--- a/tests/unit/test_config.py+++ b/tests/unit/test_config.py@@ -11,6 +11,7 @@ from openhands.core.config import (finalize_config,get_agent_config_arg,get_llm_config_arg,+ load_app_config,load_from_env,load_from_toml,)@@ -811,3 +812,29 @@ memory_max_threads = 10assert not agent_config2.memory_enabledassert agent_config2.enable_prompt_extensionsassert agent_config2.memory_max_threads == 10+++def test_agent_config_custom_group_name(temp_toml_file):+ temp_toml = """+[core]+max_iterations = 99++[agent.group1]+memory_enabled = true++[agent.group2]+memory_enabled = false+"""+ with open(temp_toml_file, 'w') as f:+ f.write(temp_toml)++ # just a sanity check that load app config wouldn't fail+ app_config = load_app_config(config_file=temp_toml_file)+ assert app_config.max_iterations == 99++ # run_infer in evaluation can use `get_agent_config_arg` to load custom+ # agent configs with any group name (not just agent name)+ agent_config1 = get_agent_config_arg('group1', temp_toml_file)+ assert agent_config1.memory_enabled+ agent_config2 = get_agent_config_arg('group2', temp_toml_file)+ assert not agent_config2.memory_enabled