Skip to content

Commit

Permalink
improve coverage of llm
Browse files Browse the repository at this point in the history
  • Loading branch information
gusye1234 committed Sep 25, 2024
1 parent 032d041 commit ba04e76
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
from nano_graphrag import _llm


def test_get_openai_async_client_instance():
with patch("nano_graphrag._llm.AsyncOpenAI") as mock_openai:
mock_openai.return_value = "CLIENT"
client = _llm.get_openai_async_client_instance()
assert client == "CLIENT"


def test_get_azure_openai_async_client_instance():
with patch("nano_graphrag._llm.AsyncAzureOpenAI") as mock_openai:
mock_openai.return_value = "AZURE_CLIENT"
client = _llm.get_azure_openai_async_client_instance()
assert client == "AZURE_CLIENT"


@pytest.fixture
def mock_openai_client():
with patch("nano_graphrag._llm.get_openai_async_client_instance") as mock_openai:
Expand Down

0 comments on commit ba04e76

Please sign in to comment.