APP-443: Fix key generation (#12726)

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: tofarr <tofarr@gmail.com>
This commit is contained in:
chuckbutkus
2026-02-03 12:50:40 -05:00
committed by GitHub
parent ce04e70b5b
commit 0e825c38d7
7 changed files with 537 additions and 102 deletions

View File

@@ -149,11 +149,10 @@ async def test_store_llm_settings_new_settings():
llm_base_url='https://api.example.com',
)
# Mock the settings store
mock_store = MagicMock()
mock_store.load = AsyncMock(return_value=None) # No existing settings
# No existing settings
existing_settings = None
result = await store_llm_settings(settings, mock_store)
result = await store_llm_settings(settings, existing_settings)
# Should return settings with the provided values
assert result.llm_model == 'gpt-4'
@@ -170,9 +169,6 @@ async def test_store_llm_settings_update_existing():
llm_base_url='https://new.example.com',
)
# Mock the settings store
mock_store = MagicMock()
# Create existing settings
existing_settings = Settings(
llm_model='gpt-3.5',
@@ -180,9 +176,7 @@ async def test_store_llm_settings_update_existing():
llm_base_url='https://old.example.com',
)
mock_store.load = AsyncMock(return_value=existing_settings)
result = await store_llm_settings(settings, mock_store)
result = await store_llm_settings(settings, existing_settings)
# Should return settings with the updated values
assert result.llm_model == 'gpt-4'
@@ -197,9 +191,6 @@ async def test_store_llm_settings_partial_update():
llm_model='gpt-4' # Only updating model
)
# Mock the settings store
mock_store = MagicMock()
# Create existing settings
existing_settings = Settings(
llm_model='gpt-3.5',
@@ -207,9 +198,7 @@ async def test_store_llm_settings_partial_update():
llm_base_url='https://existing.example.com',
)
mock_store.load = AsyncMock(return_value=existing_settings)
result = await store_llm_settings(settings, mock_store)
result = await store_llm_settings(settings, existing_settings)
# Should return settings with updated model but keep other values
assert result.llm_model == 'gpt-4'