Skip to content

Commit 044a85a

Browse files
author
Rohan Jadvani
authored
Add passwordless property to WorkOS client (#44)
1 parent 4998fb9 commit 044a85a

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

tests/test_client.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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._passwordless = None
1213
client._portal = None
1314
client._sso = None
1415

@@ -21,6 +22,9 @@ def test_initialize_audit_log(self, set_api_key_and_project_id):
2122
def test_initialize_directory_sync(self, set_api_key):
2223
assert bool(client.directory_sync)
2324

25+
def test_initialize_passwordless(self, set_api_key):
26+
assert bool(client.passwordless)
27+
2428
def test_initialize_portal(self, set_api_key):
2529
assert bool(client.portal)
2630

@@ -66,6 +70,14 @@ def test_initialize_directory_sync_missing_api_key(self):
6670

6771
assert "api_key" in message
6872

73+
def test_initialize_passwordless_missing_api_key(self):
74+
with pytest.raises(ConfigurationException) as ex:
75+
client.passwordless
76+
77+
message = str(ex)
78+
79+
assert "api_key" in message
80+
6981
def test_initialize_portal_missing_api_key(self):
7082
with pytest.raises(ConfigurationException) as ex:
7183
client.portal

workos/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
__package_url__ = "https://github.com/workos-inc/workos-python"
1414

15-
__version__ = "0.8.0"
15+
__version__ = "0.8.1"
1616

1717
__author__ = "WorkOS"
1818

workos/client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from workos.audit_trail import AuditTrail
22
from workos.directory_sync import DirectorySync
3+
from workos.passwordless import Passwordless
34
from workos.portal import Portal
45
from workos.sso import SSO
56

@@ -25,6 +26,12 @@ def directory_sync(self):
2526
self._directory_sync = DirectorySync()
2627
return self._directory_sync
2728

29+
@property
30+
def passwordless(self):
31+
if not getattr(self, "_passwordless", None):
32+
self._passwordless = Passwordless()
33+
return self._passwordless
34+
2835
@property
2936
def portal(self):
3037
if not getattr(self, "_portal", None):

0 commit comments

Comments
 (0)