mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-04 13:22:39 +02:00
add test for truncate.
This commit is contained in:
parent
05ae935d8c
commit
cfbf163084
1 changed files with 8 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import pytest
|
||||
|
||||
from metagpt.actions.execute_code import ExecutePyCode
|
||||
from metagpt.actions.execute_code import ExecutePyCode, truncate
|
||||
from metagpt.schema import Message
|
||||
|
||||
|
||||
|
|
@ -81,3 +81,10 @@ async def test_plotting_bug():
|
|||
pi = ExecutePyCode()
|
||||
output = await pi.run(code)
|
||||
assert output[1] is True
|
||||
|
||||
|
||||
def test_truncate():
|
||||
output = "hello world"
|
||||
assert truncate(output) == output
|
||||
output = "hello world"
|
||||
assert truncate(output, 5) == "Truncated to show only the last 5 characters\nworld"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue