Add unit test to check has_new_line JSON response

This commit is contained in:
MichelleTPY 2024-12-13 19:22:15 +00:00
parent 42c44893a6
commit 220cf7f780

View file

@ -25,6 +25,7 @@ def test_completion(prompt: str, n_predict: int, re_content: str, n_prompt: int,
assert res.body["timings"]["prompt_n"] == n_prompt
assert res.body["timings"]["predicted_n"] == n_predicted
assert res.body["truncated"] == truncated
assert res.body["has_new_line"] == False
assert match_regex(re_content, res.body["content"])
@ -47,6 +48,7 @@ def test_completion_stream(prompt: str, n_predict: int, re_content: str, n_promp
assert data["timings"]["prompt_n"] == n_prompt
assert data["timings"]["predicted_n"] == n_predicted
assert data["truncated"] == truncated
assert data["has_new_line"] == False
assert data["stop_type"] == "limit"
assert "generation_settings" in data
assert server.n_predict is not None