replaybuffer start/stop now check status first

add replaybuffer tests
This commit is contained in:
2025-05-26 00:20:22 +01:00
parent 0a944f1f58
commit df6f65eda0
2 changed files with 62 additions and 0 deletions

View File

@@ -18,6 +18,11 @@ def main():
@app.command('start | s')
def start(ctx: typer.Context):
"""Start the replay buffer."""
resp = ctx.obj.get_replay_buffer_status()
if resp.output_active:
err_console.print('Replay buffer is already active.')
raise typer.Exit(1)
ctx.obj.start_replay_buffer()
out_console.print('Replay buffer started.')
@@ -25,6 +30,11 @@ def start(ctx: typer.Context):
@app.command('stop | st')
def stop(ctx: typer.Context):
"""Stop the replay buffer."""
resp = ctx.obj.get_replay_buffer_status()
if not resp.output_active:
err_console.print('Replay buffer is not active.')
raise typer.Exit(1)
ctx.obj.stop_replay_buffer()
out_console.print('Replay buffer stopped.')