Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Jul 9, 2024
1 parent 09cae3c commit a7ecc80
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions bioblend/_tests/TestGalaxyUsers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import pytest

from bioblend import (
ConnectionError,
galaxy,
)
from bioblend import ConnectionError
from bioblend.galaxy import GalaxyInstance
from . import (
GalaxyTestBase,
test_util,
Expand Down Expand Up @@ -60,7 +58,7 @@ def test_create_local_user(self):
assert new_user["username"] == new_username
assert new_user["email"] == new_user_email
# test a BioBlend GalaxyInstance can be created using username+password
user_gi = galaxy.GalaxyInstance(url=self.gi.base_url, email=new_user_email, password=password)
user_gi = 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 and purging
if self.gi.config.get_config()["allow_user_deletion"]:
Expand Down Expand Up @@ -112,7 +110,7 @@ def test_update_user(self):
@test_util.skip_unless_galaxy("release_19.09") # for user purging
def test_direct_purge(self):
"""
test purgung without prior deletion
Test purging without prior deletion
"""
# WARNING: only admins can create users!
if self.gi.config.get_config()["use_remote_user"]:
Expand All @@ -123,11 +121,9 @@ def test_direct_purge(self):
new_user = self.gi.users.create_local_user(
new_username, f"{new_username}@example.org", test_util.random_string(20)
)
new_user_id = new_user["id"]

# purge user fails if not deleted
# Purging a user fails if it's not deleted beforehand
with pytest.raises(ConnectionError):
self.gi.users.delete_user(new_user_id, purge=True)
self.gi.users.delete_user(new_user["id"], purge=True)

def test_get_user_apikey(self):
# Test getting the API key of the current user, which surely has one
Expand Down

0 comments on commit a7ecc80

Please sign in to comment.