first commit

This commit is contained in:
2025-04-19 20:15:26 +01:00
commit 8ce9a80eed
23 changed files with 1317 additions and 0 deletions

32
tests/test_record.py Normal file
View File

@@ -0,0 +1,32 @@
"""Unit tests for the record command in the OBS WebSocket CLI."""
import time
from typer.testing import CliRunner
from obsws_cli.app import app
runner = CliRunner()
def test_record_start_status_stop():
"""Test the record start command."""
result = runner.invoke(app, ['record', 'start'])
assert result.exit_code == 0
assert 'Recording started successfully.' in result.stdout
time.sleep(0.5) # Wait for the recording to start
result = runner.invoke(app, ['record', 'status'])
assert result.exit_code == 0
assert 'Recording is in progress.' in result.stdout
result = runner.invoke(app, ['record', 'stop'])
assert result.exit_code == 0
assert 'Recording stopped successfully.' in result.stdout
time.sleep(0.5) # Wait for the recording to stop
result = runner.invoke(app, ['record', 'status'])
assert result.exit_code == 0
assert 'Recording is not in progress.' in result.stdout