mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
better testing
This commit is contained in:
parent
1b78202fc0
commit
701ff22b56
1 changed files with 3 additions and 8 deletions
|
@ -94,14 +94,9 @@ def test_completion_openai():
|
||||||
|
|
||||||
response_str = response['choices'][0]['message']['content']
|
response_str = response['choices'][0]['message']['content']
|
||||||
response_str_2 = response.choices[0].message.content
|
response_str_2 = response.choices[0].message.content
|
||||||
print(response_str)
|
assert response_str == response_str_2
|
||||||
print(response_str_2)
|
assert type(response_str) == str
|
||||||
if type(response_str) != str:
|
assert len(response_str) > 1
|
||||||
pytest.fail(f"Error occurred: {e}")
|
|
||||||
if type(response_str_2) != str:
|
|
||||||
pytest.fail(f"Error occurred: {e}")
|
|
||||||
# Add any assertions here to check the response
|
|
||||||
print(response)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"Error occurred: {e}")
|
pytest.fail(f"Error occurred: {e}")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue