mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2026-04-17 22:43:38 +00:00
add group commands toggle and status
add group unit tests minor version bump
This commit is contained in:
@@ -32,6 +32,8 @@ def pytest_sessionstart(session):
|
||||
)
|
||||
print(' '.join(out))
|
||||
|
||||
session.obsws.set_current_scene_collection('test-collection')
|
||||
|
||||
session.obsws.create_scene('pytest')
|
||||
session.obsws.create_input(
|
||||
sceneName='pytest',
|
||||
|
||||
43
tests/test_group.py
Normal file
43
tests/test_group.py
Normal file
@@ -0,0 +1,43 @@
|
||||
"""Unit tests for the group command in the OBS WebSocket CLI."""
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
from obsws_cli.app import app
|
||||
|
||||
runner = CliRunner()
|
||||
|
||||
|
||||
def test_group_list():
|
||||
"""Test the group list command."""
|
||||
result = runner.invoke(app, ['group', 'list', 'pytest00'])
|
||||
assert result.exit_code == 0
|
||||
assert 'test_group' in result.stdout
|
||||
|
||||
|
||||
def test_group_show():
|
||||
"""Test the group show command."""
|
||||
result = runner.invoke(app, ['group', 'show', 'pytest00', 'test_group'])
|
||||
assert result.exit_code == 0
|
||||
assert "Group 'test_group' is now visible." in result.stdout
|
||||
|
||||
|
||||
def test_group_toggle():
|
||||
"""Test the group toggle command."""
|
||||
result = runner.invoke(app, ['group', 'hide', 'pytest00', 'test_group'])
|
||||
assert result.exit_code == 0
|
||||
assert "Group 'test_group' is now hidden." in result.stdout
|
||||
|
||||
result = runner.invoke(app, ['group', 'toggle', 'pytest00', 'test_group'])
|
||||
assert result.exit_code == 0
|
||||
assert "Group 'test_group' is now visible." in result.stdout
|
||||
|
||||
|
||||
def test_group_status():
|
||||
"""Test the group status command."""
|
||||
result = runner.invoke(app, ['group', 'show', 'pytest00', 'test_group'])
|
||||
assert result.exit_code == 0
|
||||
assert "Group 'test_group' is now visible." in result.stdout
|
||||
|
||||
result = runner.invoke(app, ['group', 'status', 'pytest00', 'test_group'])
|
||||
assert result.exit_code == 0
|
||||
assert "Group 'test_group' is now visible." in result.stdout
|
||||
Reference in New Issue
Block a user