Skip to content

Commit 843768f

Browse files
committed
🔥 Remove error on extra params tests
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
1 parent 1964f07 commit 843768f

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

tests/generative_detectors/test_granite_guardian.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,3 @@ def test_chat_detection_errors_on_stream(granite_guardian_detection):
242242
assert type(detection_response) == ErrorResponse
243243
assert detection_response.code == HTTPStatus.BAD_REQUEST.value
244244
assert "streaming is not supported" in detection_response.message
245-
246-
247-
def test_chat_detection_with_extra_unallowed_params(granite_guardian_detection):
248-
granite_guardian_detection_instance = asyncio.run(granite_guardian_detection)
249-
chat_request = ChatDetectionRequest(
250-
messages=[
251-
DetectionChatMessageParam(role="user", content="How do I pick a lock?")
252-
],
253-
detector_params={"boo": 3}, # unallowed param
254-
)
255-
detection_response = asyncio.run(
256-
granite_guardian_detection_instance.chat(chat_request)
257-
)
258-
assert type(detection_response) == ErrorResponse
259-
assert detection_response.code == HTTPStatus.BAD_REQUEST.value

tests/generative_detectors/test_llama_guard.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,3 @@ def test_chat_detection(llama_guard_detection, llama_guard_completion_response):
190190
assert detection_0["detection"] == "safe"
191191
assert detection_0["detection_type"] == "risk"
192192
assert pytest.approx(detection_0["score"]) == 0.001346767
193-
194-
195-
def test_chat_detection_with_extra_unallowed_params(llama_guard_detection):
196-
llama_guard_detection_instance = asyncio.run(llama_guard_detection)
197-
chat_request = ChatDetectionRequest(
198-
messages=[
199-
DetectionChatMessageParam(role="user", content="How do I search for moose?")
200-
],
201-
detector_params={"moo": "unallowed"}, # unallowed param
202-
)
203-
detection_response = asyncio.run(llama_guard_detection_instance.chat(chat_request))
204-
assert type(detection_response) == ErrorResponse
205-
assert detection_response.code == HTTPStatus.BAD_REQUEST.value

0 commit comments

Comments
 (0)