CubeLoop — a Pythonic, async-native agent harness core designed for high performance, readability, and production-grade persistence.
Python agent-frameworkagent-harnessagent-runtimeagentic-aiai-agentsai-frameworkanthropicharnessharness-engineeringharness-frameworklanggraphlanggraph-alternativellmmcpopenaipi-agentpi-agent-corepythonpython-agent
refactor: replace hasattr checks with isinstance in test_agent.py
xf gongd3895272a342
diff --git a/tests/agent/test_agent.py b/tests/agent/test_agent.pyindex 21ed792..33e4e0c 100644--- a/tests/agent/test_agent.py+++ b/tests/agent/test_agent.py@@ -3,6 +3,7 @@ import asynciofrom cubepi.agent.agent import Agentfrom cubepi.agent.types import AgentToolfrom cubepi.providers.base import (+ AssistantMessage,Model,TextContent,UserMessage,@@ -276,14 +277,11 @@ class TestAgentResume:await agent.resume()has_follow_up = any(- hasattr(m, "content")- and hasattr(m, "role")- and m.role == "user"+ isinstance(m, UserMessage)and any(- hasattr(c, "text") and c.text == "follow-up"- for c in (m.content if isinstance(m.content, list) else [])+ isinstance(c, TextContent) and c.text == "follow-up" for c in m.content)for m in agent.state.messages)assert has_follow_up- assert agent.state.messages[-1].role == "assistant"+ assert isinstance(agent.state.messages[-1], AssistantMessage)