test: update unit tests for system message handling and workflow collaboration serices

This commit is contained in:
Novice
2026-03-19 17:19:56 +08:00
parent fefbd84c67
commit 2ce7919e6d
9 changed files with 45 additions and 17 deletions

View File

@ -134,8 +134,8 @@ class TestInitSystemMessage:
assert result == []
def test_existing_system_message_not_duplicated(self, mock_runner):
"""Test that system message is not duplicated if already present."""
def test_existing_system_message_replaced_with_template(self, mock_runner):
"""Test that existing system message is replaced with the new template."""
existing_messages = [
SystemPromptMessage(content="Existing system"),
UserPromptMessage(content="User message"),
@ -143,9 +143,8 @@ class TestInitSystemMessage:
result = mock_runner._init_system_message("New template", existing_messages)
# Should not insert new system message
assert len(result) == 2
assert result[0].content == "Existing system"
assert result[0].content == "New template"
def test_system_message_inserted_when_missing(self, mock_runner):
"""Test that system message is inserted when first message is not system."""