added test_attrs

added tests to test_request

keys in attrs() list now snake cased
This commit is contained in:
onyx-and-iris
2022-07-29 02:42:44 +01:00
parent ce9bc7e8d6
commit e145362726
6 changed files with 100 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ import tomllib
import websocket
class ObsClient(object):
class ObsClient:
DELAY = 0.001
def __init__(self, **kwargs):

View File

@@ -19,7 +19,7 @@ Subs = IntEnum(
)
class EventClient(object):
class EventClient:
DELAY = 0.001
def __init__(self, **kwargs):

View File

@@ -9,7 +9,7 @@ https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.
"""
class ReqClient(object):
class ReqClient:
def __init__(self, **kwargs):
self.base_client = ObsClient(**kwargs)
self.base_client.authenticate()

View File

@@ -12,7 +12,7 @@ def to_snake_case(s):
def as_dataclass(identifier, data):
def attrs():
return list(data.keys())
return list(to_snake_case(k) for k in data.keys())
return dataclass(
type(