Skip to content

Commit c9b1e27

Browse files
update test for new structure of custom blocklist (#36001)
1 parent f24b567 commit c9b1e27

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sdk/openai/azure-openai/tests/test_chat_completions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,8 @@ def test_chat_completion_block_list_term(self, client, api_type, api_version, **
847847
err = e.value.body
848848
assert err["code"] == "content_filter"
849849
content_filter_result = err["innererror"]["content_filter_result"]
850-
assert content_filter_result["custom_blocklists"][0]["filtered"] is True
851-
assert content_filter_result["custom_blocklists"][0]["id"].startswith("CustomBlockList")
850+
assert content_filter_result["custom_blocklists"]["filtered"] is True
851+
assert content_filter_result["custom_blocklists"]["details"][0]["id"].startswith("CustomBlockList")
852852
assert content_filter_result["hate"]["filtered"] is False
853853
assert content_filter_result["hate"]["severity"] == "safe"
854854
assert content_filter_result["self_harm"]["filtered"] is False

sdk/openai/azure-openai/tests/test_chat_completions_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,8 @@ async def test_chat_completion_block_list_term(self, client_async, api_type, api
868868
err = e.value.body
869869
assert err["code"] == "content_filter"
870870
content_filter_result = err["innererror"]["content_filter_result"]
871-
assert content_filter_result["custom_blocklists"][0]["filtered"] is True
872-
assert content_filter_result["custom_blocklists"][0]["id"].startswith("CustomBlockList")
871+
assert content_filter_result["custom_blocklists"]["filtered"] is True
872+
assert content_filter_result["custom_blocklists"]["details"][0]["id"].startswith("CustomBlockList")
873873
assert content_filter_result["hate"]["filtered"] is False
874874
assert content_filter_result["hate"]["severity"] == "safe"
875875
assert content_filter_result["self_harm"]["filtered"] is False

0 commit comments

Comments
 (0)