File size: 599 Bytes
b290e5c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from your_module.components.chat_loop import chat_loop
import unittest
from unittest.mock import MagicMock
import streamlit as st

class TestChatLoop(unittest.TestCase):

    def test_chat_loop_renders_correctly(self):
        session_state_mock = MagicMock()
        config_mock = {"chat_key": "value"}

        # Mocking Streamlit's write function
        st.write = MagicMock()

        chat_loop(session_state_mock, config_mock)

        # Assert that the chat loop writes to the screen
        st.write.assert_called_with("Chat Loop Running...")

if __name__ == '__main__':
    unittest.main()