Skip to content

Commit aaf25d0

Browse files
ccurmeopen-swe
andauthored
test(openai): drop retired completions live tests (#40910)
Co-authored-by: ccurme <[email protected]> Co-authored-by: open-swe[bot] <[email protected]>
1 parent 04ac76c commit aaf25d0

2 files changed

Lines changed: 19 additions & 272 deletions

File tree

‎libs/partners/openai/tests/integration_tests/llms/test_base.py‎

Lines changed: 0 additions & 272 deletions
This file was deleted.

‎libs/partners/openai/tests/unit_tests/llms/test_base.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,22 @@ def test_generate_streaming_multiple_prompts_error() -> None:
116116
ValueError, match="Cannot stream results with multiple prompts\\."
117117
):
118118
llm._generate(["foo", "bar"])
119+
120+
121+
def test_openai_streaming_best_of_error() -> None:
122+
with pytest.raises(ValueError):
123+
OpenAI(best_of=2, streaming=True)
124+
125+
126+
def test_openai_streaming_n_error() -> None:
127+
with pytest.raises(ValueError):
128+
OpenAI(n=2, streaming=True)
129+
130+
131+
def test_openai_modelname_to_contextsize_valid() -> None:
132+
assert OpenAI().modelname_to_contextsize("davinci") == 2049
133+
134+
135+
def test_openai_modelname_to_contextsize_invalid() -> None:
136+
with pytest.raises(ValueError):
137+
OpenAI().modelname_to_contextsize("foobar")

0 commit comments

Comments
 (0)