mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-06-07 20:20:32 +01:00
split stderr from stdout in tests
This commit is contained in:
parent
85d2cce4c6
commit
9dd5fedd92
@ -4,7 +4,7 @@ from typer.testing import CliRunner
|
|||||||
|
|
||||||
from obsws_cli.app import app
|
from obsws_cli.app import app
|
||||||
|
|
||||||
runner = CliRunner()
|
runner = CliRunner(mix_stderr=False)
|
||||||
|
|
||||||
|
|
||||||
def test_group_list():
|
def test_group_list():
|
||||||
|
@ -6,7 +6,7 @@ from typer.testing import CliRunner
|
|||||||
|
|
||||||
from obsws_cli.app import app
|
from obsws_cli.app import app
|
||||||
|
|
||||||
runner = CliRunner()
|
runner = CliRunner(mix_stderr=False)
|
||||||
|
|
||||||
|
|
||||||
def test_record_start_status_stop():
|
def test_record_start_status_stop():
|
||||||
|
@ -4,22 +4,22 @@ from typer.testing import CliRunner
|
|||||||
|
|
||||||
from obsws_cli.app import app
|
from obsws_cli.app import app
|
||||||
|
|
||||||
runner = CliRunner()
|
runner = CliRunner(mix_stderr=False)
|
||||||
|
|
||||||
|
|
||||||
def test_scene_list():
|
def test_scene_list():
|
||||||
"""Test the scene list command."""
|
"""Test the scene list command."""
|
||||||
result = runner.invoke(app, ['scene', 'list'])
|
result = runner.invoke(app, ['scene', 'list'])
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert 'pytest' in result.stdout
|
assert 'pytest_scene' in result.stdout
|
||||||
|
|
||||||
|
|
||||||
def test_scene_current():
|
def test_scene_current():
|
||||||
"""Test the scene current command."""
|
"""Test the scene current command."""
|
||||||
runner.invoke(app, ['scene', 'switch', 'pytest'])
|
runner.invoke(app, ['scene', 'switch', 'pytest_scene'])
|
||||||
result = runner.invoke(app, ['scene', 'current'])
|
result = runner.invoke(app, ['scene', 'current'])
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert 'pytest' in result.stdout
|
assert 'pytest_scene' in result.stdout
|
||||||
|
|
||||||
|
|
||||||
def test_scene_switch():
|
def test_scene_switch():
|
||||||
@ -29,10 +29,10 @@ def test_scene_switch():
|
|||||||
enabled = 'Studio mode is enabled.' in result.stdout
|
enabled = 'Studio mode is enabled.' in result.stdout
|
||||||
|
|
||||||
if enabled:
|
if enabled:
|
||||||
result = runner.invoke(app, ['scene', 'switch', 'pytest', '--preview'])
|
result = runner.invoke(app, ['scene', 'switch', 'pytest_scene', '--preview'])
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert 'Switched to preview scene: pytest' in result.stdout
|
assert 'Switched to preview scene: pytest_scene' in result.stdout
|
||||||
else:
|
else:
|
||||||
result = runner.invoke(app, ['scene', 'switch', 'pytest'])
|
result = runner.invoke(app, ['scene', 'switch', 'pytest_scene'])
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert 'Switched to program scene: pytest' in result.stdout
|
assert 'Switched to program scene: pytest_scene' in result.stdout
|
||||||
|
@ -4,12 +4,12 @@ from typer.testing import CliRunner
|
|||||||
|
|
||||||
from obsws_cli.app import app
|
from obsws_cli.app import app
|
||||||
|
|
||||||
runner = CliRunner()
|
runner = CliRunner(mix_stderr=False)
|
||||||
|
|
||||||
|
|
||||||
def test_sceneitem_list():
|
def test_sceneitem_list():
|
||||||
"""Test the sceneitem list command."""
|
"""Test the sceneitem list command."""
|
||||||
result = runner.invoke(app, ['sceneitem', 'list', 'pytest'])
|
result = runner.invoke(app, ['sceneitem', 'list', 'pytest_scene'])
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert 'pytest_input' in result.stdout
|
assert 'pytest_input' in result.stdout
|
||||||
assert 'pytest_input_2' in result.stdout
|
assert 'pytest_input_2' in result.stdout
|
||||||
@ -23,11 +23,12 @@ def test_sceneitem_transform():
|
|||||||
'sceneitem',
|
'sceneitem',
|
||||||
'transform',
|
'transform',
|
||||||
'--rotation=60',
|
'--rotation=60',
|
||||||
'pytest',
|
'pytest_scene',
|
||||||
'pytest_input_2',
|
'pytest_input_2',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert (
|
assert (
|
||||||
"Item 'pytest_input_2' in scene 'pytest' has been transformed" in result.stdout
|
"Item 'pytest_input_2' in scene 'pytest_scene' has been transformed"
|
||||||
|
in result.stdout
|
||||||
)
|
)
|
||||||
|
@ -6,7 +6,7 @@ from typer.testing import CliRunner
|
|||||||
|
|
||||||
from obsws_cli.app import app
|
from obsws_cli.app import app
|
||||||
|
|
||||||
runner = CliRunner()
|
runner = CliRunner(mix_stderr=False)
|
||||||
|
|
||||||
|
|
||||||
def test_stream_start():
|
def test_stream_start():
|
||||||
|
@ -4,7 +4,7 @@ from typer.testing import CliRunner
|
|||||||
|
|
||||||
from obsws_cli.app import app
|
from obsws_cli.app import app
|
||||||
|
|
||||||
runner = CliRunner()
|
runner = CliRunner(mix_stderr=False)
|
||||||
|
|
||||||
|
|
||||||
def test_studio_enable():
|
def test_studio_enable():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user