Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Commit a6d6a45

Browse files
committed
feat: tests
1 parent e7740ef commit a6d6a45

File tree

5 files changed

+126
-4
lines changed

5 files changed

+126
-4
lines changed

conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import os
23
import subprocess
34
import time
45
from io import BytesIO

hatchet_sdk/loader.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from pydantic import BaseModel, ConfigDict, ValidationInfo, field_validator
77

8-
from .token import get_addresses_from_jwt, get_tenant_id_from_jwt
8+
from hatchet_sdk.token import get_addresses_from_jwt, get_tenant_id_from_jwt
99

1010

1111
class ClientTLSConfig(BaseModel):
@@ -125,6 +125,9 @@ def validate_host_port(cls, host_port: str, info: ValidationInfo) -> str:
125125

126126
token = cast(str, info.data.get("token"))
127127

128+
if not token:
129+
raise ValueError("Token must be set")
130+
128131
_, grpc_broadcast_address = get_addresses_from_jwt(token)
129132

130133
return grpc_broadcast_address
@@ -142,6 +145,9 @@ def validate_server_url(cls, server_url: str, info: ValidationInfo) -> str:
142145

143146
token = cast(str, info.data.get("token"))
144147

148+
if not token:
149+
raise ValueError("Token must be set")
150+
145151
_server_url, _ = get_addresses_from_jwt(token)
146152

147153
return _server_url

0 commit comments

Comments
 (0)