Files
galaxy/test/base/api_util.py
T
John Chilton 02aeedeef7 Rework key injection logic in test framework.
Pull logic for how master and user API keys are determinined for testing out of functional_tests.py for reuse elsewhere.

This refactoring will help the creation of an API test framework.
2014-01-10 08:45:36 -06:00

21 lines
696 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.
"""
return os.environ.get( "GALAXY_TEST_MASTER_API_KEY", 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 )