mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
test bad org fix
This commit is contained in:
parent
abf14663ed
commit
7eb2af1959
1 changed files with 0 additions and 22 deletions
|
|
@ -300,28 +300,6 @@ class TestOpenAIChatCompletion(BaseLLMChatTest):
|
|||
pass
|
||||
|
||||
|
||||
def test_completion_bad_org():
|
||||
import litellm
|
||||
|
||||
litellm.set_verbose = True
|
||||
_old_org = os.environ.get("OPENAI_ORGANIZATION", None)
|
||||
os.environ["OPENAI_ORGANIZATION"] = "bad-org"
|
||||
messages = [{"role": "user", "content": "hi"}]
|
||||
|
||||
with pytest.raises(Exception) as exc_info:
|
||||
comp = litellm.completion(
|
||||
model="gpt-4o-mini", messages=messages, organization="bad-org"
|
||||
)
|
||||
|
||||
print(exc_info.value)
|
||||
assert "header should match organization for API key" in str(exc_info.value)
|
||||
|
||||
if _old_org is not None:
|
||||
os.environ["OPENAI_ORGANIZATION"] = _old_org
|
||||
else:
|
||||
del os.environ["OPENAI_ORGANIZATION"]
|
||||
|
||||
|
||||
@patch("litellm.main.openai_chat_completions._get_openai_client")
|
||||
def test_openai_max_retries_0(mock_get_openai_client):
|
||||
import litellm
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue