mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2026-04-18 06:53:38 +00:00
add bounds/crop/rotation flags to sceneitem transform
upd readme upd changelog upd tests minor bump
This commit is contained in:
@@ -71,6 +71,17 @@ def pytest_sessionstart(session):
|
||||
},
|
||||
sceneItemEnabled=True,
|
||||
)
|
||||
resp = session.obsws.get_scene_item_list('pytest')
|
||||
for item in resp.scene_items:
|
||||
if item['sourceName'] == 'pytest_input_2':
|
||||
session.obsws.set_scene_item_transform(
|
||||
'pytest',
|
||||
item['sceneItemId'],
|
||||
{
|
||||
'rotation': 0,
|
||||
},
|
||||
)
|
||||
break
|
||||
|
||||
|
||||
def pytest_sessionfinish(session, exitstatus):
|
||||
|
||||
@@ -7,9 +7,27 @@ from obsws_cli.app import app
|
||||
runner = CliRunner()
|
||||
|
||||
|
||||
def test_item_list():
|
||||
"""Test the item list command."""
|
||||
def test_sceneitem_list():
|
||||
"""Test the sceneitem list command."""
|
||||
result = runner.invoke(app, ['sceneitem', 'list', 'pytest'])
|
||||
assert result.exit_code == 0
|
||||
assert 'pytest_input' in result.stdout
|
||||
assert 'pytest_input_2' in result.stdout
|
||||
|
||||
|
||||
def test_sceneitem_transform():
|
||||
"""Test the sceneitem transform command."""
|
||||
result = runner.invoke(
|
||||
app,
|
||||
[
|
||||
'sceneitem',
|
||||
'transform',
|
||||
'--rotation=60',
|
||||
'pytest',
|
||||
'pytest_input_2',
|
||||
],
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert (
|
||||
"Item 'pytest_input_2' in scene 'pytest' has been transformed" in result.stdout
|
||||
)
|
||||
|
||||
@@ -18,7 +18,7 @@ def test_stream_start():
|
||||
result = runner.invoke(app, ['stream', 'start'])
|
||||
assert result.exit_code == 0
|
||||
|
||||
time.sleep(1) # Wait for the stream to start
|
||||
time.sleep(2) # Wait for the stream to start
|
||||
|
||||
if active:
|
||||
assert 'Streaming is already in progress, cannot start.' in result.stdout
|
||||
@@ -35,7 +35,7 @@ def test_stream_stop():
|
||||
result = runner.invoke(app, ['stream', 'stop'])
|
||||
assert result.exit_code == 0
|
||||
|
||||
time.sleep(1) # Wait for the stream to stop
|
||||
time.sleep(2) # Wait for the stream to stop
|
||||
|
||||
if active:
|
||||
assert 'Streaming stopped successfully.' in result.stdout
|
||||
|
||||
Reference in New Issue
Block a user