""" Tests for UserInterface. """ import pytest from dcos.protocols.user_interface import UserInterface, UserRequest, SystemResponse class TestUserInterface: def test_process_input(self): ui = UserInterface() request = UserRequest(input="hello", user_id="user_1") parsed = ui.process_input(request) assert parsed["intent"] == "query" def test_format_response(self): ui = UserInterface() response = SystemResponse(output="Hello!", agent_id="agent_1") formatted = ui.format_response(response) assert "[agent_1]" in formatted def test_history(self): ui = UserInterface() ui.format_response(SystemResponse(output="msg1", agent_id="a")) ui.format_response(SystemResponse(output="msg2", agent_id="b")) history = ui.get_history() assert len(history) == 2