-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/ Remove calls to add and remove members endpoints from v2 cli…
…ent (#2277) * remove call to members from add_member and remove_member methods of v2 client * pass edit invitation to edit group * revert change, add members using an edit * add whole path * add signatures * use a group edit --------- Co-authored-by: Melisa Bok <[email protected]>
- Loading branch information
1 parent
43140e3
commit 38dd2cd
Showing
3 changed files
with
73 additions
and
42 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
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 |
---|---|---|
|
@@ -1915,8 +1915,28 @@ def test_remove_email_address(self, openreview_client, helpers): | |
assert openreview_client.get_group('[email protected]').members == ['~Harold_Last1'] | ||
with pytest.raises(openreview.OpenReviewException, match=r'Group Not Found: [email protected]'): | ||
assert openreview_client.get_group('[email protected]').members == [] | ||
openreview_client.add_members_to_group('~Harold_Last1', '[email protected]') | ||
openreview_client.add_members_to_group('[email protected]', '~Harold_Last1') | ||
|
||
openreview_client.post_group_edit(invitation = 'openreview.net/-/Edit', | ||
signatures = ['~Super_User1'], | ||
group = openreview.api.Group( | ||
id = '~Harold_Last1', | ||
members = { | ||
'append': ['[email protected]'] | ||
}, | ||
signatures = ['~Super_User1'] | ||
) | ||
) | ||
|
||
openreview_client.post_group_edit(invitation = 'openreview.net/-/Edit', | ||
signatures = ['~Super_User1'], | ||
group = openreview.api.Group( | ||
id = '[email protected]', | ||
members = { | ||
'append': ['~Harold_Last1'] | ||
}, | ||
signatures = ['~Super_User1'] | ||
) | ||
) | ||
|
||
## Try to remove the unexisting name and get an error | ||
with pytest.raises(openreview.OpenReviewException, match=r'Profile not found for ~Harold_Lastt1'): | ||
|
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 |
---|---|---|
|
@@ -649,8 +649,30 @@ def test_group(self, client): | |
assert openReviewError.value.args[0].get('name') == 'ForbiddenError' | ||
|
||
def test_get_profiles_as_dict(self, openreview_client, test_client): | ||
openreview_client.add_members_to_group(openreview_client.get_group('~SomeFirstName_User1'), '[email protected]') | ||
openreview_client.add_members_to_group(openreview_client.get_group('[email protected]'), '~SomeFirstName_User1') | ||
|
||
openreview_client.post_group_edit(invitation = 'openreview.net/-/Edit', | ||
signatures = ['~Super_User1'], | ||
group = openreview.api.Group( | ||
id = '~SomeFirstName_User1', | ||
members = { | ||
'append': ['[email protected]'] | ||
}, | ||
signatures = ['~Super_User1'] | ||
) | ||
) | ||
|
||
openreview_client.post_group_edit(invitation = 'openreview.net/-/Edit', | ||
signatures = ['~Super_User1'], | ||
group = openreview.api.Group( | ||
id = '[email protected]', | ||
members = { | ||
'append': ['~SomeFirstName_User1'] | ||
}, | ||
signatures = ['~Super_User1'] | ||
) | ||
) | ||
|
||
|
||
profiles = openreview.tools.get_profiles( | ||
openreview_client, ids_or_emails=['~SomeFirstName_User1', '~Another_Name1', '[email protected]', '[email protected]', '[email protected]', '[email protected]', '~Test_Name1'], as_dict=True | ||
) | ||
|