From 9e3cbc42dd3214c68d7b3ea6543f59cb1d8effea Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Mon, 10 Jun 2024 09:54:11 -0700 Subject: [PATCH] update test for new structure of custom blocklist --- sdk/openai/azure-openai/tests/test_chat_completions.py | 4 ++-- sdk/openai/azure-openai/tests/test_chat_completions_async.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/openai/azure-openai/tests/test_chat_completions.py b/sdk/openai/azure-openai/tests/test_chat_completions.py index ce8e526a0d46..b70421e187ea 100644 --- a/sdk/openai/azure-openai/tests/test_chat_completions.py +++ b/sdk/openai/azure-openai/tests/test_chat_completions.py @@ -847,8 +847,8 @@ def test_chat_completion_block_list_term(self, client, api_type, api_version, ** err = e.value.body assert err["code"] == "content_filter" content_filter_result = err["innererror"]["content_filter_result"] - assert content_filter_result["custom_blocklists"][0]["filtered"] is True - assert content_filter_result["custom_blocklists"][0]["id"].startswith("CustomBlockList") + assert content_filter_result["custom_blocklists"]["filtered"] is True + assert content_filter_result["custom_blocklists"]["details"][0]["id"].startswith("CustomBlockList") assert content_filter_result["hate"]["filtered"] is False assert content_filter_result["hate"]["severity"] == "safe" assert content_filter_result["self_harm"]["filtered"] is False diff --git a/sdk/openai/azure-openai/tests/test_chat_completions_async.py b/sdk/openai/azure-openai/tests/test_chat_completions_async.py index 1ebd605514b2..f8fb91b3790e 100644 --- a/sdk/openai/azure-openai/tests/test_chat_completions_async.py +++ b/sdk/openai/azure-openai/tests/test_chat_completions_async.py @@ -868,8 +868,8 @@ async def test_chat_completion_block_list_term(self, client_async, api_type, api err = e.value.body assert err["code"] == "content_filter" content_filter_result = err["innererror"]["content_filter_result"] - assert content_filter_result["custom_blocklists"][0]["filtered"] is True - assert content_filter_result["custom_blocklists"][0]["id"].startswith("CustomBlockList") + assert content_filter_result["custom_blocklists"]["filtered"] is True + assert content_filter_result["custom_blocklists"]["details"][0]["id"].startswith("CustomBlockList") assert content_filter_result["hate"]["filtered"] is False assert content_filter_result["hate"]["severity"] == "safe" assert content_filter_result["self_harm"]["filtered"] is False