fixed test for CI

This commit is contained in:
Nicholas Albion
2023-09-27 12:45:20 +10:00
parent 7a81b599c7
commit b0fea79c7b

View File

@@ -101,8 +101,9 @@ class TestLlmConnection:
builtins.print, ipc_client_instance = get_custom_print({})
@patch('utils.llm_connection.requests.post')
def test_stream_gpt_completion(self, mock_post):
def test_stream_gpt_completion(self, mock_post, monkeypatch):
# Given streaming JSON response
monkeypatch.setenv('OPENAI_API_KEY', 'secret')
deltas = ['{', '\\n',
' \\"foo\\": \\"bar\\",', '\\n',
' \\"prompt\\": \\"Hello\\",', '\\n',