File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ class TestClient(object):
99 def setup (self ):
1010 client ._audit_trail = None
1111 client ._directory_sync = None
12+ client ._organizations = None
1213 client ._passwordless = None
1314 client ._portal = None
1415 client ._sso = None
@@ -22,6 +23,9 @@ def test_initialize_audit_log(self, set_api_key):
2223 def test_initialize_directory_sync (self , set_api_key ):
2324 assert bool (client .directory_sync )
2425
26+ def test_initialize_organizations (self , set_api_key ):
27+ assert bool (client .organizations )
28+
2529 def test_initialize_passwordless (self , set_api_key ):
2630 assert bool (client .passwordless )
2731
@@ -70,6 +74,14 @@ def test_initialize_directory_sync_missing_api_key(self):
7074
7175 assert "api_key" in message
7276
77+ def test_initialize_organizations_missing_api_key (self ):
78+ with pytest .raises (ConfigurationException ) as ex :
79+ client .organizations
80+
81+ message = str (ex )
82+
83+ assert "api_key" in message
84+
7385 def test_initialize_passwordless_missing_api_key (self ):
7486 with pytest .raises (ConfigurationException ) as ex :
7587 client .passwordless
Original file line number Diff line number Diff line change 11from workos .audit_trail import AuditTrail
22from workos .directory_sync import DirectorySync
3+ from workos .organizations import Organizations
34from workos .passwordless import Passwordless
45from workos .portal import Portal
56from workos .sso import SSO
@@ -26,6 +27,12 @@ def directory_sync(self):
2627 self ._directory_sync = DirectorySync ()
2728 return self ._directory_sync
2829
30+ @property
31+ def organizations (self ):
32+ if not getattr (self , "_organizations" , None ):
33+ self ._organizations = Organizations ()
34+ return self ._organizations
35+
2936 @property
3037 def passwordless (self ):
3138 if not getattr (self , "_passwordless" , None ):
Original file line number Diff line number Diff line change 1313REQUIRED_SETTINGS_FOR_MODULE = {
1414 AUDIT_TRAIL_MODULE : ["api_key" ,],
1515 DIRECTORY_SYNC_MODULE : ["api_key" ,],
16- ORGANIZATIONS_MODULE : ["api_key" ],
16+ ORGANIZATIONS_MODULE : ["api_key" , ],
1717 PASSWORDLESS_MODULE : ["api_key" ,],
1818 PORTAL_MODULE : ["api_key" ,],
1919 SSO_MODULE : ["api_key" , "client_id" ,],
You can’t perform that action at this time.
0 commit comments