new_wukong/tests/core/test_echo.py
ZZY 6cc18ed15c refactor(main): 使用异步执行优化执行流水线
重构ExecutePipeline类以支持异步执行,通过使用asyncio和async def main()函数实现。此更改允许更高效的执行流水线中的任务,并通过异步I/O提高整体性能。
2024-08-30 18:58:16 +08:00

13 lines
377 B
Python

import unittest
from src.core import tools
from io import StringIO
import sys
class TestEcho(unittest.TestCase):
def test_base(self):
echoMid = tools.EchoMiddleWare()
captured_out = StringIO()
sys.stdout = captured_out
echoMid.process('hello')
sys.stdout = sys.__stdout__
self.assertEqual(captured_out.getvalue(), 'hello\n')