Skip to content

Commit

Permalink
Add unit test to check has_new_line JSON response
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleTanPY committed Dec 13, 2024
1 parent 42c4489 commit 220cf7f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/server/tests/unit/test_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])


Expand All @@ -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
Expand Down

0 comments on commit 220cf7f

Please sign in to comment.