From 2c95befb03f99ed2007961d5affa87522566c36a Mon Sep 17 00:00:00 2001 From: vsakkas Date: Sun, 12 May 2024 12:27:11 +0200 Subject: [PATCH] Add testing for invalid parameters (#172) - Add testing for invalid parameters when creating a Sydney client --- tests/test_ask.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_ask.py b/tests/test_ask.py index 2875215..f3350d9 100644 --- a/tests/test_ask.py +++ b/tests/test_ask.py @@ -289,7 +289,7 @@ async def test_ask_travel_persona() -> bool: @pytest.mark.asyncio -async def test_ask_travel_cooking() -> bool: +async def test_ask_cooking_persona() -> bool: expected_responses = [ "Hello! This is Cooking Assistant. How can I assist you today? 😊", "Hello! This is Cooking Assistant. How can I assist you in the kitchen today? 😊", @@ -308,7 +308,7 @@ async def test_ask_travel_cooking() -> bool: @pytest.mark.asyncio -async def test_ask_travel_fitness() -> bool: +async def test_ask_fitness_persona() -> bool: expected_responses = [ "Hello! How can I assist you with your fitness journey today? 😊", "Hello! This is Fitness Trainer. How can I assist you today? 😊", @@ -325,3 +325,10 @@ async def test_ask_travel_fitness() -> bool: return True assert False, f"Unexpected response: {response}, match score: {score}" + + +@pytest.mark.asyncio +async def test_ask_invalid_style() -> None: + with pytest.raises(KeyError): + async with SydneyClient(style="invalid") as sydney: + _ = await sydney.ask("Hello, Copilot!")