mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
using the following command: ``` autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E201,E202 . ```
25 lines
821 B
Python
25 lines
821 B
Python
import os
|
|
|
|
DEFAULT_GALAXY_MASTER_API_KEY = "TEST123"
|
|
DEFAULT_GALAXY_USER_API_KEY = None
|
|
|
|
|
|
def get_master_api_key():
|
|
""" Test master API key to use for functional test. This key should be
|
|
configured as a master API key and should be able to create additional
|
|
users and keys.
|
|
"""
|
|
for key in ["GALAXY_CONFIG_MASTER_API_KEY", "GALAXY_CONFIG_OVERRIDE_MASTER_API_KEY"]:
|
|
value = os.environ.get(key, None)
|
|
if value:
|
|
return value
|
|
return DEFAULT_GALAXY_MASTER_API_KEY
|
|
|
|
|
|
def get_user_api_key():
|
|
""" Test user API key to use for functional tests. If set, this should drive
|
|
API based testing - if not set master API key should be used to create a new
|
|
user and API key for tests.
|
|
"""
|
|
return os.environ.get("GALAXY_TEST_USER_API_KEY", DEFAULT_GALAXY_USER_API_KEY)
|