2022-07-26 21:48:52 +01:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from tests import req_cl
|
|
|
|
|
|
|
|
|
|
|
|
class TestRequests:
|
|
|
|
__test__ = True
|
|
|
|
|
|
|
|
def test_get_version(self):
|
|
|
|
resp = req_cl.get_version()
|
|
|
|
assert "obsVersion" in resp
|
|
|
|
assert "obsWebSocketVersion" in resp
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
"scene",
|
|
|
|
[
|
|
|
|
("START"),
|
|
|
|
("BRB"),
|
|
|
|
("END"),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_current_program_scene(self, scene):
|
|
|
|
req_cl.set_current_program_scene(scene)
|
|
|
|
resp = req_cl.get_current_program_scene()
|
|
|
|
assert resp["currentProgramSceneName"] == scene
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
"state",
|
|
|
|
[
|
|
|
|
(False),
|
|
|
|
(True),
|
|
|
|
],
|
|
|
|
)
|
2022-07-27 19:39:33 +01:00
|
|
|
def test_studio_mode_enabled(self, state):
|
2022-07-26 21:48:52 +01:00
|
|
|
req_cl.set_studio_mode_enabled(state)
|
|
|
|
resp = req_cl.get_studio_mode_enabled()
|
|
|
|
assert resp["studioModeEnabled"] == state
|
2022-07-27 19:39:33 +01:00
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
"name,data",
|
|
|
|
[
|
|
|
|
("val1", 3),
|
|
|
|
("val2", "hello"),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_persistent_data(self, name, data):
|
|
|
|
req_cl.set_persistent_data("OBS_WEBSOCKET_DATA_REALM_PROFILE", name, data)
|
|
|
|
resp = req_cl.get_persistent_data("OBS_WEBSOCKET_DATA_REALM_PROFILE", name)
|
|
|
|
assert resp["slotValue"] == data
|