-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add add_user_to_organization and remove_user_to_organization methods
- Loading branch information
1 parent
a9df256
commit a78404d
Showing
2 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,3 +160,19 @@ def test_list_users_returns_metadata( | |
dict_users = users.to_dict() | ||
assert dict_users["metadata"]["params"]["email"] == "[email protected]" | ||
assert dict_users["metadata"]["params"]["organization"] == "foo-corp.com" | ||
|
||
def test_add_user_to_organization(self, capture_and_mock_request, mock_user): | ||
url, _ = capture_and_mock_request("post", mock_user, 200) | ||
|
||
user = self.users.add_user_to_organization("user_123", "org_123") | ||
|
||
assert url[0].endswith("users/user_123/organization/org_123") | ||
assert user["id"] == "user_01H7ZGXFP5C6BBQY6Z7277ZCT0" | ||
|
||
def test_remove_user_from_organization(self, capture_and_mock_request, mock_user): | ||
url, _ = capture_and_mock_request("delete", mock_user, 200) | ||
|
||
user = self.users.remove_user_from_organization("user_123", "org_123") | ||
|
||
assert url[0].endswith("users/user_123/organization/org_123") | ||
assert user["id"] == "user_01H7ZGXFP5C6BBQY6Z7277ZCT0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters