Skip to content

Commit 9b1afed

Browse files
committed
added none test
1 parent 8990e9a commit 9b1afed

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

descope/descope_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def __init__(
7777
# Management Initialization
7878
mgmt_http_client = HTTPClient(
7979
project_id=project_id,
80-
base_url=auth_http_client.base_url,
81-
timeout_seconds=auth_http_client.timeout_seconds,
82-
secure=auth_http_client.secure,
80+
base_url=base_url,
81+
timeout_seconds=timeout_seconds,
82+
secure=not skip_verify,
8383
management_key=management_key or os.getenv("DESCOPE_MANAGEMENT_KEY"),
8484
)
8585
self._mgmt = MGMT(

tests/test_descope_client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,19 @@ def test_base_url_setting(self):
10671067
# Verify that the base_url is set in the mgmt HTTP client
10681068
self.assertEqual(client._mgmt._http.base_url, custom_base_url)
10691069

1070+
def test_base_url_none(self):
1071+
"""Test that base_url=None uses default base URL from environment or project ID"""
1072+
# When base_url is None, it should use DESCOPE_BASE_URI env var or computed default
1073+
client = DescopeClient(
1074+
project_id=self.dummy_project_id,
1075+
base_url=None,
1076+
public_key=self.public_key_dict,
1077+
)
1078+
1079+
expected_base_url = common.DEFAULT_BASE_URL
1080+
self.assertEqual(client._auth.http_client.base_url, expected_base_url)
1081+
self.assertEqual(client._mgmt._http.base_url, expected_base_url)
1082+
10701083

10711084
if __name__ == "__main__":
10721085
unittest.main()

0 commit comments

Comments
 (0)