Skip to content

Commit 7db99a0

Browse files
committed
Address code review comment: type check for has_new_line in unit test
1 parent 4de800c commit 7db99a0

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 type(res.body["has_new_line"]) == bool
2829
assert match_regex(re_content, res.body["content"])
2930

3031

@@ -48,6 +49,7 @@ def test_completion_stream(prompt: str, n_predict: int, re_content: str, n_promp
4849
assert data["timings"]["predicted_n"] == n_predicted
4950
assert data["truncated"] == truncated
5051
assert data["stop_type"] == "limit"
52+
assert type(data["has_new_line"]) == bool
5153
assert "generation_settings" in data
5254
assert server.n_predict is not None
5355
assert data["generation_settings"]["n_predict"] == min(n_predict, server.n_predict)

0 commit comments

Comments
 (0)