Skip to content

Commit 220cf7f

Browse files
committed
Add unit test to check has_new_line JSON response
1 parent 42c4489 commit 220cf7f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/server/tests/unit/test_completion.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def test_completion(prompt: str, n_predict: int, re_content: str, n_prompt: int,
2525
assert res.body["timings"]["prompt_n"] == n_prompt
2626
assert res.body["timings"]["predicted_n"] == n_predicted
2727
assert res.body["truncated"] == truncated
28+
assert res.body["has_new_line"] == False
2829
assert match_regex(re_content, res.body["content"])
2930

3031

@@ -47,6 +48,7 @@ def test_completion_stream(prompt: str, n_predict: int, re_content: str, n_promp
4748
assert data["timings"]["prompt_n"] == n_prompt
4849
assert data["timings"]["predicted_n"] == n_predicted
4950
assert data["truncated"] == truncated
51+
assert data["has_new_line"] == False
5052
assert data["stop_type"] == "limit"
5153
assert "generation_settings" in data
5254
assert server.n_predict is not None

0 commit comments

Comments
 (0)