-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve user_id description, set email where needed
- Loading branch information
Showing
3 changed files
with
5 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,7 @@ def _setup_user_get_key(self, email, password=None): | |
return user, self._post(f"users/{user['id']}/api_key", admin=True).json() | ||
|
||
@contextmanager | ||
def _different_user(self, email: Optional[str] = OTHER_USER, anon=False): | ||
def _different_user(self, email: Optional[str] = None, anon=False): | ||
"""Use in test cases to switch get/post operations to act as new user | ||
..code-block:: python | ||
|
@@ -156,7 +156,6 @@ def _different_user(self, email: Optional[str] = OTHER_USER, anon=False): | |
self._get("histories") # Gets [email protected] histories. | ||
""" | ||
email = OTHER_USER if email is None else email | ||
original_api_key = self.user_api_key | ||
original_interactor_key = self.galaxy_interactor.api_key | ||
original_cookies = self.galaxy_interactor.cookies | ||
|
@@ -165,6 +164,7 @@ def _different_user(self, email: Optional[str] = OTHER_USER, anon=False): | |
self.galaxy_interactor.cookies = cookies | ||
new_key = None | ||
else: | ||
email = OTHER_USER if email is None else email | ||
_, new_key = self._setup_user_get_key(email) | ||
try: | ||
self.user_api_key = new_key | ||
|