Build and run agents you can see, understand and trust.
Python agentchatbotlarge-language-modelsllmllm-agentmcpmulti-agentmulti-modalreact-agentrealtime-agentvoice-agentvoice-assistant
test(read): use portable missing file path (#2620)
wangtao254c81a41c45
diff --git a/tests/builtin_read_test.py b/tests/builtin_read_test.pyindex 28d4fcf67..c729aa610 100644--- a/tests/builtin_read_test.py+++ b/tests/builtin_read_test.py@@ -4,6 +4,7 @@ import base64import ioimport osimport tempfile+import uuidfrom unittest.async_case import IsolatedAsyncioTestCasefrom utils import AnyString@@ -178,7 +179,11 @@ class ReadToolTest(IsolatedAsyncioTestCase):async def test_read_nonexistent_file(self) -> None:"""Test reading a non-existent file."""- chunk = await self.read_tool(file_path="/nonexistent/file.txt")+ missing_path = os.path.join(+ os.path.abspath(tempfile.gettempdir()),+ f"agentscope-no-such-file-{uuid.uuid4().hex}.txt",+ )+ chunk = await self.read_tool(file_path=missing_path)self.assertEqual(chunk.state, "error")self.assertIn("does not exist", chunk.content[0].text)