Skip to content

Commit

Permalink
mock patch socket
Browse files Browse the repository at this point in the history
  • Loading branch information
vowelparrot committed Jun 19, 2023
1 parent 3afc268 commit 94d940d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/unit_tests/client/test_runner_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,17 @@ async def mock_arun_chain(
{"result": f"Result for example {example.id}"} for _ in range(n_repetitions)
]

def mock_create_session(*args: Any, **kwargs: Any) -> None:
pass

with mock.patch.object(
LangChainPlusClient, "read_dataset", new=mock_read_dataset
), mock.patch.object(
LangChainPlusClient, "list_examples", new=mock_list_examples
), mock.patch(
"langchain.client.runner_utils._arun_llm_or_chain", new=mock_arun_chain
), mock.patch.object(
LangChainPlusClient, "create_session", new=mock_create_session
):
client = LangChainPlusClient(api_url="http://localhost:1984", api_key="123")
chain = mock.MagicMock()
Expand Down

0 comments on commit 94d940d

Please sign in to comment.