@ -12,7 +12,7 @@ class Client:
|
|||||||
base_url: str = attr.ib(default="https://api.kittycad.io")
|
base_url: str = attr.ib(default="https://api.kittycad.io")
|
||||||
cookies: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
|
cookies: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
|
||||||
headers: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
|
headers: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
|
||||||
timeout: float = attr.ib(5.0, kw_only=True)
|
timeout: float = attr.ib(50.0, kw_only=True)
|
||||||
verify_ssl: Union[str, bool, ssl.SSLContext] = attr.ib(True, kw_only=True)
|
verify_ssl: Union[str, bool, ssl.SSLContext] = attr.ib(True, kw_only=True)
|
||||||
|
|
||||||
def get_headers(self) -> Dict[str, str]:
|
def get_headers(self) -> Dict[str, str]:
|
||||||
|
@ -13,6 +13,8 @@ def test_get_session():
|
|||||||
# Get the session.
|
# Get the session.
|
||||||
session: AuthSession = meta_debug_session.sync(client=client)
|
session: AuthSession = meta_debug_session.sync(client=client)
|
||||||
|
|
||||||
|
assert session != None
|
||||||
|
|
||||||
print(f"Session: {session}")
|
print(f"Session: {session}")
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
@ -21,7 +23,9 @@ async def test_get_session_async():
|
|||||||
client = AuthenticatedClientFromEnv()
|
client = AuthenticatedClientFromEnv()
|
||||||
|
|
||||||
# Get the session.
|
# Get the session.
|
||||||
session: AuthSession = meta_debug_session.asyncio(client=client)
|
session: AuthSession = await meta_debug_session.asyncio(client=client)
|
||||||
|
|
||||||
|
assert session != None
|
||||||
|
|
||||||
print(f"Session: {session}")
|
print(f"Session: {session}")
|
||||||
|
|
||||||
@ -31,6 +35,9 @@ def test_get_instance():
|
|||||||
|
|
||||||
# Get the instance.
|
# Get the instance.
|
||||||
instance: InstanceMetadata = meta_debug_instance.sync(client=client)
|
instance: InstanceMetadata = meta_debug_instance.sync(client=client)
|
||||||
|
|
||||||
|
assert instance != None
|
||||||
|
|
||||||
print(f"Instance: {instance}")
|
print(f"Instance: {instance}")
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
@ -40,4 +47,7 @@ async def test_get_instance_async():
|
|||||||
|
|
||||||
# Get the instance.
|
# Get the instance.
|
||||||
instance: InstanceMetadata = await meta_debug_instance.asyncio(client=client)
|
instance: InstanceMetadata = await meta_debug_instance.asyncio(client=client)
|
||||||
|
|
||||||
|
assert instance != None
|
||||||
|
|
||||||
print(f"Instance: {instance}")
|
print(f"Instance: {instance}")
|
||||||
|
Reference in New Issue
Block a user