Skip to content

Commit aa1c222

Browse files
Merge users branch Into main (#213)
* Add `Users` client and `Users.create_user()` method (#191) * Add Users client and Users.create_user() method * Fix comment and format. * Get user. (#192) * Add `Users.list_users()` (#193) * Add `Users.list_users()` * Do not use f-string * Fix comment * Fix format * Remove User type, and other fields * Add add_user_to_organization and remove_user_to_organization methods (#195) * Add `Users.authenticate_with_magic_auth()` (#196) * Add authenticate_with_magic_auth * Update comment * Add `Users.authenticate_with_password()` (#197) * Add `Users.authenticate_with_password()` * Fix method * Update comment * Update test * Add `Users.authenticate_with_code()` (#198) * Add `Users.authenticate_with_token()` method * Rename method * Fix test * Add `Users.create_password_challenge()` method (#199) * Add `Users.complete_password_reset()` method (#200) * Add `Users.send_verification_email()` method (#201) * Add `Users.send_verification_email()` method * Fix Magic Auth challenge * Fix test * Add `Users.verify_email()` method (#202) * Add `Users.send_magic_auth_code()` method (#203) * Add `Users.send_magic_auth_code()` method * Fix test * Fix test 2 * Return `User` instead of `MagicAuthChallenge` response (#204) * Magic Auth and Email Verification response returns User Response instead of MagicAuthChallenge Response * Replace other magic_auth_challenge_id references * Add users.delete_user() method (#205) * Fix authenticate methods (#206) * Add `users.update_user_password()` method (#207) * Add `users.update_user()` method (#208) * Fix Verify Email Code method (#209) --------- Co-authored-by: Jônatas Santos <[email protected]>
1 parent 2667837 commit aa1c222

10 files changed

+1115
-0
lines changed

tests/test_client.py

+29
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def setup(self):
1414
client._passwordless = None
1515
client._portal = None
1616
client._sso = None
17+
client._users = None
1718

1819
def test_initialize_sso(self, set_api_key_and_client_id):
1920
assert bool(client.sso)
@@ -36,6 +37,9 @@ def test_initialize_passwordless(self, set_api_key):
3637
def test_initialize_portal(self, set_api_key):
3738
assert bool(client.portal)
3839

40+
def test_initialize_users(self, set_api_key, set_client_id):
41+
assert bool(client.users)
42+
3943
def test_initialize_sso_missing_api_key(self, set_client_id):
4044
with pytest.raises(ConfigurationException) as ex:
4145
client.sso
@@ -107,3 +111,28 @@ def test_initialize_portal_missing_api_key(self):
107111
message = str(ex)
108112

109113
assert "api_key" in message
114+
115+
def test_initialize_users_missing_client_id(self, set_api_key):
116+
with pytest.raises(ConfigurationException) as ex:
117+
client.users
118+
119+
message = str(ex)
120+
121+
assert "client_id" in message
122+
123+
def test_initialize_users_missing_api_key(self, set_client_id):
124+
with pytest.raises(ConfigurationException) as ex:
125+
client.users
126+
127+
message = str(ex)
128+
129+
assert "api_key" in message
130+
131+
def test_initialize_users_missing_api_key_and_client_id(self):
132+
with pytest.raises(ConfigurationException) as ex:
133+
client.users
134+
135+
message = str(ex)
136+
137+
assert "api_key" in message
138+
assert "client_id" in message

0 commit comments

Comments
 (0)