mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-08-03 10:31:46 +00:00
upd test delays to 500ms
This commit is contained in:
parent
f335d8ffd2
commit
52e13922dc
@ -49,7 +49,9 @@ def test_record_toggle():
|
||||
|
||||
result = runner.invoke(app, ['record', 'toggle'])
|
||||
assert result.exit_code == 0
|
||||
|
||||
time.sleep(0.5) # Wait for the recording to toggle
|
||||
|
||||
if active:
|
||||
assert 'Recording stopped successfully.' in result.stdout
|
||||
else:
|
||||
|
@ -1,6 +1,7 @@
|
||||
"""Unit tests for the replaybuffer command in the OBS WebSocket CLI."""
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
import pytest
|
||||
from typer.testing import CliRunner
|
||||
@ -23,6 +24,9 @@ def test_replaybuffer_start():
|
||||
active = 'Replay buffer is active.' in resp.stdout
|
||||
|
||||
resp = runner.invoke(app, ['replaybuffer', 'start'])
|
||||
|
||||
time.sleep(0.5) # Wait for the replay buffer to start
|
||||
|
||||
if active:
|
||||
assert resp.exit_code != 0
|
||||
assert 'Replay buffer is already active.' in resp.stderr
|
||||
@ -38,6 +42,9 @@ def test_replaybuffer_stop():
|
||||
active = 'Replay buffer is active.' in resp.stdout
|
||||
|
||||
resp = runner.invoke(app, ['replaybuffer', 'stop'])
|
||||
|
||||
time.sleep(0.5) # Wait for the replay buffer to stop
|
||||
|
||||
if not active:
|
||||
assert resp.exit_code != 0
|
||||
assert 'Replay buffer is not active.' in resp.stderr
|
||||
@ -53,9 +60,11 @@ def test_replaybuffer_toggle():
|
||||
active = 'Replay buffer is active.' in resp.stdout
|
||||
|
||||
resp = runner.invoke(app, ['replaybuffer', 'toggle'])
|
||||
assert resp.exit_code == 0
|
||||
|
||||
time.sleep(0.5) # Wait for the replay buffer to toggle
|
||||
|
||||
if active:
|
||||
assert resp.exit_code == 0
|
||||
assert 'Replay buffer is not active.' in resp.stdout
|
||||
else:
|
||||
assert resp.exit_code == 0
|
||||
assert 'Replay buffer is active.' in resp.stdout
|
||||
|
@ -23,7 +23,7 @@ def test_stream_start():
|
||||
else:
|
||||
assert result.exit_code == 0
|
||||
assert 'Streaming started successfully.' in result.stdout
|
||||
time.sleep(1) # Wait for the streaming to start
|
||||
time.sleep(0.5) # Wait for the streaming to start
|
||||
|
||||
|
||||
def test_stream_stop():
|
||||
@ -37,7 +37,7 @@ def test_stream_stop():
|
||||
if active:
|
||||
assert result.exit_code == 0
|
||||
assert 'Streaming stopped successfully.' in result.stdout
|
||||
time.sleep(1) # Wait for the streaming to stop
|
||||
time.sleep(0.5) # Wait for the streaming to stop
|
||||
else:
|
||||
assert result.exit_code != 0
|
||||
assert 'Streaming is not in progress, cannot stop.' in result.stderr
|
||||
@ -52,7 +52,7 @@ def test_stream_toggle():
|
||||
result = runner.invoke(app, ['stream', 'toggle'])
|
||||
assert result.exit_code == 0
|
||||
|
||||
time.sleep(1) # Wait for the stream to toggle
|
||||
time.sleep(0.5) # Wait for the stream to toggle
|
||||
|
||||
if active:
|
||||
assert 'Streaming stopped successfully.' in result.stdout
|
||||
|
Loading…
x
Reference in New Issue
Block a user