mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-05 05:42:37 +02:00
fix "AttributeError: 'str' object has no attribute 'equals'"
This commit is contained in:
parent
dafb352b75
commit
5bf03ad89d
1 changed files with 5 additions and 5 deletions
|
|
@ -1,13 +1,13 @@
|
|||
import pytest
|
||||
|
||||
from metagpt.actions.clone_function import CloneFunction, run_fucntion_code
|
||||
from metagpt.actions.clone_function import CloneFunction, run_function_code
|
||||
|
||||
|
||||
source_code = """
|
||||
def user_indicator():
|
||||
import pandas as pd
|
||||
import ta
|
||||
import pandas as pd
|
||||
import ta
|
||||
|
||||
def user_indicator():
|
||||
# 读取股票数据
|
||||
stock_data = pd.read_csv('./tests/data/baba_stock.csv')
|
||||
stock_data.head()
|
||||
|
|
@ -48,7 +48,7 @@ async def test_clone_function():
|
|||
code = await clone.run(template_code, source_code)
|
||||
assert 'def ' in code
|
||||
stock_path = './tests/data/baba_stock.csv'
|
||||
df, msg = run_fucntion_code(code, 'stock_indicator', stock_path)
|
||||
df, msg = run_function_code(code, 'stock_indicator', stock_path)
|
||||
assert not msg
|
||||
expected_df = get_expected_res()
|
||||
assert df.equals(expected_df)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue