Skip to content

Commit

Permalink
Fix Github action tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bmquinn committed Feb 1, 2024
1 parent 61f1378 commit b4bc082
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions chat/test/handlers/test_streaming_socket_callback_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
)
from src.websocket import Websocket

class MockClient:
def post_to_connection(self, Data, ConnectionId):
return Data

class TestMyStreamingSocketCallbackHandler(TestCase):
def test_on_new_llm_token(self):
handler = StreamingSocketCallbackHandler(Websocket(), False)
handler = StreamingSocketCallbackHandler(Websocket(client=MockClient()), False)
result = handler.on_llm_new_token(token="test")
self.assertEqual(result, "test")
self.assertFalse(handler.debug_mode)

def test_debug_mode(self):
handler = StreamingSocketCallbackHandler(Websocket(), debug_mode=True)
handler = StreamingSocketCallbackHandler(Websocket(client=MockClient()), debug_mode=True)
self.assertTrue(handler.debug_mode)

0 comments on commit b4bc082

Please sign in to comment.