-
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.
Test various configuration options (ftp_upload_dir, ftp_upload_identifier, ftp_upload_dir_template) and various upload API parameters (space_to_tab, to_posix_lines, auto_decompress).
- Loading branch information
Showing
6 changed files
with
287 additions
and
28 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 |
---|---|---|
|
@@ -8,14 +8,16 @@ | |
assert_not_has_keys, | ||
assert_status_code_is, | ||
) | ||
from .api_util import get_master_api_key, get_user_api_key | ||
from .api_util import ( | ||
ADMIN_TEST_USER, | ||
get_master_api_key, | ||
get_user_api_key, | ||
OTHER_USER, | ||
TEST_USER, | ||
) | ||
from .interactor import GalaxyInteractorApi as BaseInteractor | ||
from .testcase import FunctionalTestCase | ||
|
||
TEST_USER = "[email protected]" | ||
ADMIN_TEST_USER = "[email protected]" | ||
DEFAULT_OTHER_USER = "[email protected]" # A second user for API testing. | ||
|
||
|
||
class UsesApiTestCaseMixin: | ||
|
||
|
@@ -48,7 +50,7 @@ def _setup_user_get_key(self, email): | |
return self._post("users/%s/api_key" % user["id"], admin=True).json() | ||
|
||
@contextmanager | ||
def _different_user(self, email=DEFAULT_OTHER_USER): | ||
def _different_user(self, email=OTHER_USER): | ||
""" Use in test cases to switch get/post operations to act as new user, | ||
with self._different_user( "[email protected]" ): | ||
|
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 |
---|---|---|
|
@@ -3,6 +3,14 @@ | |
DEFAULT_GALAXY_MASTER_API_KEY = "TEST123" | ||
DEFAULT_GALAXY_USER_API_KEY = None | ||
|
||
DEFAULT_TEST_USER = "[email protected]" | ||
DEFAULT_ADMIN_TEST_USER = "[email protected]" | ||
DEFAULT_OTHER_USER = "[email protected]" # A second user for API testing. | ||
|
||
TEST_USER = os.environ.get("GALAXY_TEST_USER_EMAIL", DEFAULT_TEST_USER) | ||
ADMIN_TEST_USER = os.environ.get("GALAXY_TEST_ADMIN_USER_EMAIL", DEFAULT_ADMIN_TEST_USER) | ||
OTHER_USER = os.environ.get("GALAXY_TEST_OTHER_USER_EMAIL", DEFAULT_OTHER_USER) | ||
|
||
|
||
def get_master_api_key(): | ||
""" Test master API key to use for functional test. This key should be | ||
|
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""Just constants useful for testing across test types.""" | ||
|
||
# Following constants used by upload tests. | ||
ONE_TO_SIX_WITH_SPACES = "1 2 3\n4 5 6\n" | ||
ONE_TO_SIX_WITH_TABS = "1\t2\t3\n4\t5\t6\n" | ||
ONE_TO_SIX_ON_WINDOWS = "1\t2\t3\r4\t5\t6\r" |
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.