mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
- Moved `autogpt` and `forge` to project root - Removed `autogpts` directory - Moved and renamed submodule `autogpts/autogpt/tests/vcr_cassettes` to `autogpt/tests/vcr_cassettes` - When using CLI agents will be created in `agents` directory (instead of `autogpts`) - Renamed relevant docs, code and config references from `autogpts/[forge|autogpt]` to `[forge|autogpt]` and from `*../../*` to `*../*` - Updated `CODEOWNERS`, GitHub Actions and Docker `*.yml` configs - Updated symbolic links in `docs`
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
import time
|
|
|
|
from autogpt.app.spinner import Spinner
|
|
|
|
ALMOST_DONE_MESSAGE = "Almost done..."
|
|
PLEASE_WAIT = "Please wait..."
|
|
|
|
|
|
def test_spinner_initializes_with_default_values():
|
|
"""Tests that the spinner initializes with default values."""
|
|
with Spinner() as spinner:
|
|
assert spinner.message == "Loading..."
|
|
assert spinner.delay == 0.1
|
|
|
|
|
|
def test_spinner_initializes_with_custom_values():
|
|
"""Tests that the spinner initializes with custom message and delay values."""
|
|
with Spinner(message=PLEASE_WAIT, delay=0.2) as spinner:
|
|
assert spinner.message == PLEASE_WAIT
|
|
assert spinner.delay == 0.2
|
|
|
|
|
|
#
|
|
def test_spinner_stops_spinning():
|
|
"""Tests that the spinner starts spinning and stops spinning without errors."""
|
|
with Spinner() as spinner:
|
|
time.sleep(1)
|
|
assert not spinner.running
|
|
|
|
|
|
def test_spinner_can_be_used_as_context_manager():
|
|
"""Tests that the spinner can be used as a context manager."""
|
|
with Spinner() as spinner:
|
|
assert spinner.running
|
|
assert not spinner.running
|