Download tests/test_chat_loop.py from Chemically-motivated/OSINT_Tool: direct link, hf CLI and curl.
- Browser
- Download file 599 Bytes
-
https://huggingface.co/spaces/Chemically-motivated/OSINT_Tool/resolve/main/tests/test_chat_loop.py
- Command line
-
hf download hf://spaces/Chemically-motivated/OSINT_Tool/tests/test_chat_loop.py
-
curl -L -o test_chat_loop.py https://huggingface.co/spaces/Chemically-motivated/OSINT_Tool/resolve/main/tests/test_chat_loop.py
599 Bytes
| 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() | |