Spaces:
Sleeping
Sleeping
| import unittest | |
| from unittest.mock import MagicMock, create_autospec | |
| from data_service import DataService | |
| from llm_service import LLMService | |
| from g34_final_project import App | |
| import os | |
| class TestApp(unittest.TestCase): | |
| def test_app(self): | |
| """ | |
| A simple test method to allow launching of the application with mock objects | |
| rather than the actual implementations. Used for testing the UI. | |
| """ | |
| mock_data_service = DataService().build | |
| with mock_data_service() as data_service: | |
| with LLMService().with_key(os.getenv("OPENAI_API_KEY")).with_data_service(data_service).build() as llm_service: | |
| # Replacing the call to get_summary with a mock since this isn't implemented yet. | |
| llm_service.get_summary = MagicMock(return_value="This is a summary") | |
| app = App(data_service, llm_service) | |
| app.launch() | |