-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into integrate-notification-system
- Loading branch information
Showing
27 changed files
with
328 additions
and
197 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
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
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
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
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
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ def test_get_users(self): | |
for user in users: | ||
assert user["id"] is not None | ||
assert user["email"] is not None | ||
assert user["deleted"] is not None | ||
|
||
def test_show_user(self): | ||
current_user = self.gi.users.get_current_user() | ||
|
@@ -23,10 +24,9 @@ def test_show_user(self): | |
# assert user["nice_total_disk_usage"] == current_user["nice_total_disk_usage"] | ||
# assert user["total_disk_usage"] == current_user["total_disk_usage"] | ||
|
||
@test_util.skip_unless_galaxy("release_19.09") # for user purging | ||
def test_create_remote_user(self): | ||
# WARNING: only admins can create users! | ||
# WARNING: Users cannot be purged through the Galaxy API, so execute | ||
# this test only on a disposable Galaxy instance! | ||
if not self.gi.config.get_config()["use_remote_user"]: | ||
self.skipTest("This Galaxy instance is not configured to use remote users") | ||
new_user_email = "[email protected]" | ||
|
@@ -36,11 +36,17 @@ def test_create_remote_user(self): | |
deleted_user = self.gi.users.delete_user(user["id"]) | ||
assert deleted_user["email"] == new_user_email | ||
assert deleted_user["deleted"] | ||
assert not deleted_user["purged"] | ||
|
||
purged_user = self.gi.users.delete_user(user["id"], purge=True) | ||
# email is redacted when purging a user | ||
assert purged_user["email"] != new_user_email | ||
assert purged_user["deleted"] | ||
assert purged_user["purged"] | ||
|
||
@test_util.skip_unless_galaxy("release_19.09") # for user purging | ||
def test_create_local_user(self): | ||
# WARNING: only admins can create users! | ||
# WARNING: Users cannot be purged through the Galaxy API, so execute | ||
# this test only on a disposable Galaxy instance! | ||
if self.gi.config.get_config()["use_remote_user"]: | ||
self.skipTest("This Galaxy instance is not configured to use local users") | ||
new_username = test_util.random_string() | ||
|
@@ -52,11 +58,20 @@ def test_create_local_user(self): | |
# test a BioBlend GalaxyInstance can be created using username+password | ||
user_gi = bioblend.galaxy.GalaxyInstance(url=self.gi.base_url, email=new_user_email, password=password) | ||
assert user_gi.users.get_current_user()["email"] == new_user_email | ||
# test deletion | ||
# test deletion and purging | ||
if self.gi.config.get_config()["allow_user_deletion"]: | ||
deleted_user = self.gi.users.delete_user(new_user["id"]) | ||
assert deleted_user["username"] == new_username | ||
assert deleted_user["email"] == new_user_email | ||
assert deleted_user["deleted"] | ||
assert not deleted_user["purged"] | ||
|
||
purged_user = self.gi.users.delete_user(new_user["id"], purge=True) | ||
# username and email are redacted when purging a user | ||
assert purged_user["username"] != new_username | ||
assert purged_user["email"] != new_user_email | ||
assert purged_user["deleted"] | ||
assert purged_user["purged"] | ||
|
||
def test_get_current_user(self): | ||
user = self.gi.users.get_current_user() | ||
|
@@ -66,10 +81,9 @@ def test_get_current_user(self): | |
assert user["nice_total_disk_usage"] is not None | ||
assert user["total_disk_usage"] is not None | ||
|
||
@test_util.skip_unless_galaxy("release_19.09") # for user purging | ||
def test_update_user(self): | ||
# WARNING: only admins can create users! | ||
# WARNING: Users cannot be purged through the Galaxy API, so execute | ||
# this test only on a disposable Galaxy instance! | ||
if self.gi.config.get_config()["use_remote_user"]: | ||
self.skipTest("This Galaxy instance is not configured to use local users") | ||
new_username = test_util.random_string() | ||
|
@@ -84,8 +98,12 @@ def test_update_user(self): | |
assert updated_user["username"] == updated_username | ||
assert updated_user["email"] == updated_user_email | ||
|
||
# delete and purge user after test (if possile) | ||
if self.gi.config.get_config()["allow_user_deletion"]: | ||
self.gi.users.delete_user(new_user_id) | ||
purged_user = self.gi.users.delete_user(new_user_id, purge=True) | ||
assert purged_user["deleted"] | ||
assert purged_user["purged"] | ||
|
||
def test_get_user_apikey(self): | ||
# Test getting the API key of the current user, which surely has one | ||
|
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
Oops, something went wrong.