15 lines
446 B
Python
15 lines
446 B
Python
from unittest.mock import patch
|
|
|
|
from llm_chat.chat import Chat
|
|
|
|
|
|
def test_send_message() -> None:
|
|
with patch("llm_chat.chat.Chat._make_request") as mock_make_request:
|
|
mock_make_request.return_value = {
|
|
"choices": [{"message": {"content": "Hello!"}}]
|
|
}
|
|
conversation = Chat()
|
|
response = conversation.send_message("Hello")
|
|
assert isinstance(response, str)
|
|
assert response == "Hello!"
|