Add: backend testing script for new states
This commit is contained in:
@@ -18,6 +18,27 @@ from typing import Any
|
||||
from urllib.error import HTTPError, URLError
|
||||
from urllib.request import Request, urlopen
|
||||
|
||||
ANIMATION_NAMES = (
|
||||
"idle",
|
||||
"happy",
|
||||
"love",
|
||||
"excited",
|
||||
"celebrate",
|
||||
"sleepy",
|
||||
"snoring",
|
||||
"working",
|
||||
"angry",
|
||||
"surprised",
|
||||
"shy",
|
||||
"dragging",
|
||||
# Backward-compatible aliases mapped in runtime/manifests.
|
||||
"active",
|
||||
"success",
|
||||
"error",
|
||||
# Intentionally invalid to keep unknown-animation traffic coverage.
|
||||
"unknown_anim",
|
||||
)
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(
|
||||
@@ -205,9 +226,7 @@ def random_valid_command(rng: random.Random) -> dict[str, Any]:
|
||||
|
||||
if pick == "play_animation":
|
||||
payload = {
|
||||
"name": rng.choice(
|
||||
["idle", "dance", "typing", "celebrate", "error", "unknown_anim"]
|
||||
),
|
||||
"name": rng.choice(ANIMATION_NAMES),
|
||||
"priority": rng.randint(0, 10),
|
||||
"duration_ms": rng.choice([None, 250, 500, 1000, 3000]),
|
||||
"interrupt": rng.choice([None, True, False]),
|
||||
|
||||
Reference in New Issue
Block a user