mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2024-11-22 04:40:53 +00:00
reqclient methods now snake cased.
getter, setter added. initial test commit
This commit is contained in:
parent
d36b9cf713
commit
eed83946c8
File diff suppressed because it is too large
Load Diff
11
tests/__init__.py
Normal file
11
tests/__init__.py
Normal file
@ -0,0 +1,11 @@
|
||||
import obsstudio_sdk as obs
|
||||
|
||||
req_cl = obs.ReqClient()
|
||||
|
||||
|
||||
def setup_module():
|
||||
pass
|
||||
|
||||
|
||||
def teardown_module():
|
||||
req_cl.base_client.ws.close()
|
39
tests/test_request.py
Normal file
39
tests/test_request.py
Normal file
@ -0,0 +1,39 @@
|
||||
import time
|
||||
|
||||
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),
|
||||
],
|
||||
)
|
||||
def test_set_studio_mode_enabled_true(self, state):
|
||||
req_cl.set_studio_mode_enabled(state)
|
||||
resp = req_cl.get_studio_mode_enabled()
|
||||
assert resp["studioModeEnabled"] == state
|
Loading…
Reference in New Issue
Block a user