Compare commits

..

No commits in common. "530daced5695f59627fed8688d9b5edddc9a3fb6" and "704c8c1bf433b2d1a8656d0bb16b39f91c22df8d" have entirely different histories.

6 changed files with 25 additions and 38 deletions

View File

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online> # SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
__version__ = "0.14.1" __version__ = "0.14.0"

View File

@ -80,4 +80,4 @@ def status(ctx: typer.Context):
else: else:
out_console.print('Streaming is in progress.') out_console.print('Streaming is in progress.')
else: else:
out_console.print('Streaming is not in progress.') err_console.print('Streaming is not in progress.')

View File

@ -47,7 +47,7 @@ cli = "obsws-cli {args:}"
man = "python man/generate.py --output=./man" man = "python man/generate.py --output=./man"
[tool.hatch.envs.hatch-test] [tool.hatch.envs.hatch-test]
randomize = true dependencies = ["pytest>=8.3.5"]
[tool.hatch.envs.types] [tool.hatch.envs.types]
extra-dependencies = ["mypy>=1.0.0"] extra-dependencies = ["mypy>=1.0.0"]

View File

@ -138,10 +138,6 @@ def pytest_sessionfinish(session, exitstatus):
if resp.output_active: if resp.output_active:
session.obsws.stop_replay_buffer() session.obsws.stop_replay_buffer()
resp = session.obsws.get_studio_mode_enabled()
if resp.studio_mode_enabled:
session.obsws.set_studio_mode_enabled(False)
# Close the OBS WebSocket client connection # Close the OBS WebSocket client connection
session.obsws.disconnect() session.obsws.disconnect()

View File

@ -9,36 +9,27 @@ from obsws_cli.app import app
runner = CliRunner(mix_stderr=False) runner = CliRunner(mix_stderr=False)
def test_record_start(): def test_record_start_status_stop():
"""Test the record start command.""" """Test the record start command."""
result = runner.invoke(app, ['record', 'status'])
assert result.exit_code == 0
active = 'Recording is in progress.' in result.stdout
result = runner.invoke(app, ['record', 'start']) result = runner.invoke(app, ['record', 'start'])
if active: assert result.exit_code == 0
assert result.exit_code != 0 assert 'Recording started successfully.' in result.stdout
assert 'Recording is already in progress, cannot start.' in result.stderr
else:
assert result.exit_code == 0
assert 'Recording started successfully.' in result.stdout
time.sleep(0.5) # Wait for the recording to start
time.sleep(0.5) # Wait for the recording to start
def test_record_stop():
"""Test the record stop command."""
result = runner.invoke(app, ['record', 'status']) result = runner.invoke(app, ['record', 'status'])
assert result.exit_code == 0 assert result.exit_code == 0
active = 'Recording is in progress.' in result.stdout assert 'Recording is in progress.' in result.stdout
result = runner.invoke(app, ['record', 'stop']) result = runner.invoke(app, ['record', 'stop'])
if not active: assert result.exit_code == 0
assert result.exit_code != 0 assert 'Recording stopped successfully. Saved to:' in result.stdout
assert 'Recording is not in progress, cannot stop.' in result.stderr
else: time.sleep(0.5) # Wait for the recording to stop
assert result.exit_code == 0
assert 'Recording stopped successfully. Saved to:' in result.stdout result = runner.invoke(app, ['record', 'status'])
time.sleep(0.5) # Wait for the recording to stop assert result.exit_code == 0
assert 'Recording is not in progress.' in result.stdout
def test_record_toggle(): def test_record_toggle():

View File

@ -16,14 +16,14 @@ def test_stream_start():
active = 'Streaming is in progress' in result.stdout active = 'Streaming is in progress' in result.stdout
result = runner.invoke(app, ['stream', 'start']) result = runner.invoke(app, ['stream', 'start'])
assert result.exit_code == 0
time.sleep(2) # Wait for the stream to start
if active: if active:
assert result.exit_code != 0 assert 'Streaming is already in progress, cannot start.' in result.stdout
assert 'Streaming is already in progress, cannot start.' in result.stderr
else: else:
assert result.exit_code == 0
assert 'Streaming started successfully.' in result.stdout assert 'Streaming started successfully.' in result.stdout
time.sleep(1) # Wait for the streaming to start
def test_stream_stop(): def test_stream_stop():
@ -33,14 +33,14 @@ def test_stream_stop():
active = 'Streaming is in progress' in result.stdout active = 'Streaming is in progress' in result.stdout
result = runner.invoke(app, ['stream', 'stop']) result = runner.invoke(app, ['stream', 'stop'])
assert result.exit_code == 0
time.sleep(2) # Wait for the stream to stop
if active: if active:
assert result.exit_code == 0
assert 'Streaming stopped successfully.' in result.stdout assert 'Streaming stopped successfully.' in result.stdout
time.sleep(1) # Wait for the streaming to stop
else: else:
assert result.exit_code != 0 assert 'Streaming is not in progress, cannot stop.' in result.stdout
assert 'Streaming is not in progress, cannot stop.' in result.stderr
def test_stream_toggle(): def test_stream_toggle():
@ -52,7 +52,7 @@ def test_stream_toggle():
result = runner.invoke(app, ['stream', 'toggle']) result = runner.invoke(app, ['stream', 'toggle'])
assert result.exit_code == 0 assert result.exit_code == 0
time.sleep(1) # Wait for the stream to toggle time.sleep(2) # Wait for the stream to toggle
if active: if active:
assert 'Streaming stopped successfully.' in result.stdout assert 'Streaming stopped successfully.' in result.stdout