add autogenerated reqclient methods

update tests so they pass

add Taskfile

add hatch-dotenv plugin
This commit is contained in:
2026-03-26 07:05:34 +00:00
parent 4e9fb934be
commit 9d99ea0aea
7 changed files with 2274 additions and 1935 deletions

View File

@@ -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"