mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-14 15:25:17 +02:00
allow di to use terminal tool, add tool log fn, expand truncate len
This commit is contained in:
parent
3e10d34468
commit
53240b91f2
7 changed files with 118 additions and 2 deletions
15
tests/metagpt/tools/libs/test_terminal.py
Normal file
15
tests/metagpt/tools/libs/test_terminal.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from metagpt.const import DATA_PATH, METAGPT_ROOT
|
||||
from metagpt.tools.libs.terminal import Terminal
|
||||
|
||||
|
||||
def test_terminal():
|
||||
terminal = Terminal()
|
||||
|
||||
terminal.run_command(f"cd {METAGPT_ROOT}")
|
||||
output = terminal.run_command("pwd")
|
||||
assert output.strip() == str(METAGPT_ROOT)
|
||||
|
||||
# pwd now should be METAGPT_ROOT, cd data should land in DATA_PATH
|
||||
terminal.run_command("cd data")
|
||||
output = terminal.run_command("pwd")
|
||||
assert output.strip() == str(DATA_PATH)
|
||||
Loading…
Add table
Add a link
Reference in a new issue