openai/openai-python

Public

mirrored fromhttps://github.com/openai/openai-pythonAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
1bdabb489a86bd721a3e237d8556583ed0d8dfa1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

tests/lib/test_old_api.py

17lines · modecode

1import pytest
2
3import openai
4from openai.lib._old_api import APIRemovedInV1
5
6
7def test_basic_attribute_access_works() -> None:
8 for attr in dir(openai):
9 getattr(openai, attr)
10
11
12def test_helpful_error_is_raised() -> None:
13 with pytest.raises(APIRemovedInV1):
14 openai.Completion.create() # type: ignore
15
16 with pytest.raises(APIRemovedInV1):
17 openai.ChatCompletion.create() # type: ignore
18