From 1dd6992129bace52b22ad83b6d267c3c4018b0d5 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Mon, 19 May 2025 01:45:31 +0100 Subject: [PATCH] add output to scene switch command add unit test patch bump --- obsws_cli/__about__.py | 2 +- obsws_cli/scene.py | 2 ++ tests/test_scene.py | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/obsws_cli/__about__.py b/obsws_cli/__about__.py index 92afa06..7ccc259 100644 --- a/obsws_cli/__about__.py +++ b/obsws_cli/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2025-present onyx-and-iris # # SPDX-License-Identifier: MIT -__version__ = "0.10.4" +__version__ = "0.10.5" diff --git a/obsws_cli/scene.py b/obsws_cli/scene.py index 1ea4e56..75bf1a0 100644 --- a/obsws_cli/scene.py +++ b/obsws_cli/scene.py @@ -65,5 +65,7 @@ def switch( if preview: ctx.obj.set_current_preview_scene(scene_name) + typer.echo(f'Switched to preview scene: {scene_name}') else: ctx.obj.set_current_program_scene(scene_name) + typer.echo(f'Switched to program scene: {scene_name}') diff --git a/tests/test_scene.py b/tests/test_scene.py index d8eab3e..fc08579 100644 --- a/tests/test_scene.py +++ b/tests/test_scene.py @@ -20,3 +20,19 @@ def test_scene_current(): result = runner.invoke(app, ['scene', 'current']) assert result.exit_code == 0 assert 'pytest' in result.stdout + + +def test_scene_switch(): + """Test the scene switch command.""" + result = runner.invoke(app, ['studiomode', 'status']) + assert result.exit_code == 0 + enabled = 'Studio mode is enabled.' in result.stdout + + if enabled: + result = runner.invoke(app, ['scene', 'switch', 'pytest', '--preview']) + assert result.exit_code == 0 + assert 'Switched to preview scene: pytest' in result.stdout + else: + result = runner.invoke(app, ['scene', 'switch', 'pytest']) + assert result.exit_code == 0 + assert 'Switched to program scene: pytest' in result.stdout