Spaces:
Build error
Build error
Download tests/conftest.py from LolorzoloL/AutoGPTWeb: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/LolorzoloL/AutoGPTWeb/resolve/main/tests/conftest.py
- Command line
-
hf download hf://spaces/LolorzoloL/AutoGPTWeb/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/LolorzoloL/AutoGPTWeb/resolve/main/tests/conftest.py
1.09 kB
| from pathlib import Path | |
| import pytest | |
| from pytest_mock import MockerFixture | |
| from autogpt.config import Config | |
| from autogpt.llm import ApiManager | |
| from autogpt.workspace import Workspace | |
| pytest_plugins = ["tests.integration.agent_factory"] | |
| def workspace_root(tmp_path: Path) -> Path: | |
| return tmp_path / "home/users/monty/auto_gpt_workspace" | |
| def workspace(workspace_root: Path) -> Workspace: | |
| workspace_root = Workspace.make_workspace(workspace_root) | |
| return Workspace(workspace_root, restrict_to_workspace=True) | |
| def config(mocker: MockerFixture, workspace: Workspace) -> Config: | |
| config = Config() | |
| # Do a little setup and teardown since the config object is a singleton | |
| mocker.patch.multiple( | |
| config, | |
| workspace_path=workspace.root, | |
| file_logger_path=workspace.get_path("file_logger.txt"), | |
| ) | |
| yield config | |
| def api_manager() -> ApiManager: | |
| if ApiManager in ApiManager._instances: | |
| del ApiManager._instances[ApiManager] | |
| return ApiManager() | |