mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2026-04-18 14:03:32 +00:00
add autogenerated reqclient methods
update tests so they pass add Taskfile add hatch-dotenv plugin
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
import obsws_python as obsws
|
||||
@@ -8,7 +10,11 @@ class TestErrors:
|
||||
__test__ = True
|
||||
|
||||
def test_it_raises_an_obssdk_error_on_incorrect_password(self):
|
||||
bad_conn = {"host": "localhost", "port": 4455, "password": "incorrectpassword"}
|
||||
bad_conn = {
|
||||
"host": os.getenv("OBSWS_TEST_HOST", "localhost"),
|
||||
"port": int(os.getenv("OBSWS_TEST_PORT", 4455)),
|
||||
"password": "incorrectpassword",
|
||||
}
|
||||
with pytest.raises(
|
||||
obsws.error.OBSSDKError,
|
||||
match="failed to identify client with the server, please check connection settings",
|
||||
@@ -16,7 +22,11 @@ class TestErrors:
|
||||
obsws.ReqClient(**bad_conn)
|
||||
|
||||
def test_it_raises_an_obssdk_error_if_auth_enabled_but_no_password_provided(self):
|
||||
bad_conn = {"host": "localhost", "port": 4455, "password": ""}
|
||||
bad_conn = {
|
||||
"host": os.getenv("OBSWS_TEST_HOST", "localhost"),
|
||||
"port": int(os.getenv("OBSWS_TEST_PORT", 4455)),
|
||||
"password": "",
|
||||
}
|
||||
with pytest.raises(
|
||||
obsws.error.OBSSDKError,
|
||||
match="authentication enabled but no password provided",
|
||||
@@ -28,7 +38,7 @@ class TestErrors:
|
||||
obsws.error.OBSSDKRequestError,
|
||||
match="Request SetCurrentProgramScene returned code 600. With message: No source was found by the name of `invalid`.",
|
||||
) as exc_info:
|
||||
req_cl.set_current_program_scene("invalid")
|
||||
req_cl.set_current_program_scene(scene_name="invalid")
|
||||
|
||||
e = exc_info.value
|
||||
assert e.req_name == "SetCurrentProgramScene"
|
||||
|
||||
Reference in New Issue
Block a user