Coverage for src/integry/client.py: 82%
18 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-03-26 01:26 +0500
« prev ^ index » next coverage.py v7.6.1, created at 2025-03-26 01:26 +0500
1import httpx
3from integry.resources.functions.api import Functions
4from integry.resources.apps.api import Apps
7class Integry(httpx.AsyncClient):
9 apps: Apps
10 functions: Functions
12 app_key: str
13 app_secret: str
15 def __init__(self, app_key: str, app_secret: str, *args, **kwargs):
16 if not app_key: 16 ↛ 17line 16 didn't jump to line 17 because the condition on line 16 was never true
17 raise Exception("app_key must be provided when initializing Integry")
19 if not app_secret: 19 ↛ 20line 19 didn't jump to line 20 because the condition on line 19 was never true
20 raise Exception("app_secret must be provided when initializing Integry")
22 self.app_key = app_key
23 self.app_secret = app_secret
25 self.functions = Functions(self, app_key, app_secret, "functions")
26 self.apps = Apps(self, app_key, app_secret, "apps")
28 super().__init__(*args, **kwargs, base_url="https://api.integry.io", timeout=30)