Download tests/test_chat_box.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/51d1e833318492e8e0cd2326e65bb27608426071/tests/test_chat_box.py
- Command line
-
hf download hf://spaces/Chemically-motivated/OSINT_Tool@51d1e833318492e8e0cd2326e65bb27608426071/tests/test_chat_box.py
-
curl -L -o test_chat_box.py https://huggingface.co/spaces/Chemically-motivated/OSINT_Tool/resolve/51d1e833318492e8e0cd2326e65bb27608426071/tests/test_chat_box.py
599 Bytes
| from your_module.components.chat_box import chat_box | |
| import unittest | |
| from unittest.mock import MagicMock | |
| import streamlit as st | |
| class TestChatBox(unittest.TestCase): | |
| def test_chat_box_renders_correctly(self): | |
| session_state_mock = MagicMock() | |
| config_mock = {"chat_key": "value"} | |
| # Mocking Streamlit's text input | |
| st.text_input = MagicMock() | |
| chat_box(session_state_mock, config_mock) | |
| # Assert that the text_input function was called | |
| st.text_input.assert_called_with("Enter your message:") | |
| if __name__ == '__main__': | |
| unittest.main() | |