mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2026-04-18 06:53:38 +00:00
split stderr from stdout in tests
This commit is contained in:
@@ -4,22 +4,22 @@ from typer.testing import CliRunner
|
||||
|
||||
from obsws_cli.app import app
|
||||
|
||||
runner = CliRunner()
|
||||
runner = CliRunner(mix_stderr=False)
|
||||
|
||||
|
||||
def test_scene_list():
|
||||
"""Test the scene list command."""
|
||||
result = runner.invoke(app, ['scene', 'list'])
|
||||
assert result.exit_code == 0
|
||||
assert 'pytest' in result.stdout
|
||||
assert 'pytest_scene' in result.stdout
|
||||
|
||||
|
||||
def test_scene_current():
|
||||
"""Test the scene current command."""
|
||||
runner.invoke(app, ['scene', 'switch', 'pytest'])
|
||||
runner.invoke(app, ['scene', 'switch', 'pytest_scene'])
|
||||
result = runner.invoke(app, ['scene', 'current'])
|
||||
assert result.exit_code == 0
|
||||
assert 'pytest' in result.stdout
|
||||
assert 'pytest_scene' in result.stdout
|
||||
|
||||
|
||||
def test_scene_switch():
|
||||
@@ -29,10 +29,10 @@ def test_scene_switch():
|
||||
enabled = 'Studio mode is enabled.' in result.stdout
|
||||
|
||||
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 'Switched to preview scene: pytest' in result.stdout
|
||||
assert 'Switched to preview scene: pytest_scene' in result.stdout
|
||||
else:
|
||||
result = runner.invoke(app, ['scene', 'switch', 'pytest'])
|
||||
result = runner.invoke(app, ['scene', 'switch', 'pytest_scene'])
|
||||
assert result.exit_code == 0
|
||||
assert 'Switched to program scene: pytest' in result.stdout
|
||||
assert 'Switched to program scene: pytest_scene' in result.stdout
|
||||
|
||||
Reference in New Issue
Block a user