add test_regex_pattern_matching_e2e_test

This commit is contained in:
Ishaan Jaff 2024-11-25 15:39:42 -08:00
parent f76d0e41ef
commit a18aeaa2fb
2 changed files with 23 additions and 0 deletions

View file

@ -473,6 +473,24 @@ async def test_openai_wildcard_chat_completion():
await chat_completion(session=session, key=key, model="gpt-3.5-turbo-0125")
@pytest.mark.asyncio
async def test_regex_pattern_matching_e2e_test():
"""
- Create key for model = "custom-llm-engine/*" -> this has access to all models matching pattern = "custom-llm-engine/*"
- proxy_server_config.yaml has model = "custom-llm-engine/*"
- Make chat completion call
"""
async with aiohttp.ClientSession() as session:
key_gen = await generate_key(session=session, models=["custom-llm-engine/*"])
key = key_gen["key"]
# call chat/completions with a model that the key was not created for + the model is not on the config.yaml
await chat_completion(
session=session, key=key, model="custom-llm-engine/very-new-model"
)
@pytest.mark.asyncio
async def test_proxy_all_models():
"""