Skip to content

Commit a645759

Browse files
committed
fix test
1 parent f039c7c commit a645759

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

tests/unit/test_config.py

+33-3
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ def test_env_overrides_sandbox_toml(monkeypatch, default_config, temp_toml_file)
245245
workspace_base = "/opt/files3/workspace"
246246
247247
[sandbox]
248-
sandbox_type = "e2b"
249-
sandbox_timeout = 500
250-
sandbox_user_id = 1001
248+
box_type = "e2b"
249+
timeout = 500
250+
user_id = 1001
251251
""")
252252

253253
monkeypatch.setenv('LLM_API_KEY', 'env-api-key')
@@ -283,6 +283,36 @@ def test_env_overrides_sandbox_toml(monkeypatch, default_config, temp_toml_file)
283283
assert default_config.workspace_mount_path == os.getcwd() + '/UNDEFINED'
284284

285285

286+
def test_sandbox_config_from_toml(default_config, temp_toml_file):
287+
# Test loading configuration from a new-style TOML file
288+
with open(temp_toml_file, 'w', encoding='utf-8') as toml_file:
289+
toml_file.write(
290+
"""
291+
[core]
292+
workspace_base = "/opt/files/workspace"
293+
294+
[llm]
295+
model = "test-model"
296+
297+
[sandbox]
298+
box_type = "local"
299+
timeout = 1
300+
container_image = "custom_image"
301+
user_id = 1001
302+
"""
303+
)
304+
305+
load_from_toml(default_config, temp_toml_file)
306+
load_from_env(default_config, os.environ)
307+
finalize_config(default_config)
308+
309+
assert default_config.llm.model == 'test-model'
310+
assert default_config.sandbox.box_type == 'local'
311+
assert default_config.sandbox.timeout == 1
312+
assert default_config.sandbox.container_image == 'custom_image'
313+
assert default_config.sandbox.user_id == 1001
314+
315+
286316
def test_defaults_dict_after_updates(default_config):
287317
# Test that `defaults_dict` retains initial values after updates.
288318
initial_defaults = default_config.defaults_dict

0 commit comments

Comments
 (0)