mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
Merge pull request #1184 from better629/feat_werewolf
Feat fix test_an ut failed without simulator
This commit is contained in:
commit
aa715fcace
2 changed files with 13 additions and 1 deletions
|
|
@ -39,7 +39,9 @@ def get_observation_space() -> spaces.Dict:
|
|||
(spaces.Text(16), spaces.Text(16))
|
||||
), # TODO should be tuple of variable length
|
||||
"player_hunted": spaces.Text(16),
|
||||
"player_current_dead": spaces.Tuple((spaces.Text(16))), # TODO should be tuple of variable length
|
||||
"player_current_dead": spaces.Tuple(
|
||||
(spaces.Text(16), spaces.Text(16))
|
||||
), # TODO should be tuple of variable length
|
||||
"witch_poison_left": spaces.Discrete(2),
|
||||
"witch_antidote_left": spaces.Discrete(2),
|
||||
"winner": spaces.Text(16),
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import asyncio
|
|||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import metagpt
|
||||
from metagpt.const import TEST_DATA_PATH
|
||||
from metagpt.environment.android.android_env import AndroidEnv
|
||||
from metagpt.ext.android_assistant.actions.manual_record import ManualRecord
|
||||
|
|
@ -14,6 +15,10 @@ from metagpt.ext.android_assistant.actions.screenshot_parse import ScreenshotPar
|
|||
from metagpt.ext.android_assistant.actions.self_learn_and_reflect import (
|
||||
SelfLearnAndReflect,
|
||||
)
|
||||
from tests.metagpt.environment.android_env.test_android_ext_env import (
|
||||
mock_device_shape,
|
||||
mock_list_devices,
|
||||
)
|
||||
|
||||
TASK_PATH = TEST_DATA_PATH.joinpath("andriod_assistant/unitest_Contacts")
|
||||
TASK_PATH.mkdir(parents=True, exist_ok=True)
|
||||
|
|
@ -25,6 +30,11 @@ device_id = "emulator-5554"
|
|||
xml_dir = Path("/sdcard")
|
||||
screenshot_dir = Path("/sdcard/Pictures/Screenshots")
|
||||
|
||||
|
||||
metagpt.environment.android.android_ext_env.AndroidExtEnv.execute_adb_with_cmd = mock_device_shape
|
||||
metagpt.environment.android.android_ext_env.AndroidExtEnv.list_devices = mock_list_devices
|
||||
|
||||
|
||||
test_env_self_learn_android = AndroidEnv(
|
||||
device_id=device_id,
|
||||
xml_dir=xml_dir,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue