Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load_tests(loader, tests, pattern):
"""Provide a TestSuite to the discovery process."""
test_dir = os.path.join(os.path.dirname(__file__), TESTS_DIR)
conf = config.CONF.heat_plugin
if conf.auth_url is None:
# It's not configured, let's not load tests
return
manager = clients.ClientManager(conf)
endpoint = manager.identity_client.get_endpoint_url(
'orchestration', conf.region)
host = urlparse.urlparse(endpoint).hostname
os.environ['OS_TOKEN'] = manager.identity_client.auth_token
os.environ['PREFIX'] = test.rand_name('api')
return driver.build_tests(test_dir, loader, host=host,
url=endpoint, test_loader_name=__name__)
def load_tests(loader, tests, pattern):
"""Provide a TestSuite to the discovery process."""
# Set and environment variable for one of the tests.
os.environ['GABBI_TEST_URL'] = 'takingnames'
prefix = os.environ.get('GABBI_PREFIX')
test_dir = os.path.join(os.path.dirname(__file__), TESTS_DIR)
return driver.build_tests(test_dir, loader, host=None,
intercept=simple_wsgi.SimpleWsgi,
prefix=prefix,
fixture_module=sys.modules[__name__],
response_handlers=[TestResponseHandler])
def load_tests(loader, tests, pattern):
"""Provide a TestSuite to the discovery process."""
test_dir = os.path.join(os.path.dirname(__file__), TESTS_DIR)
return driver.build_tests(test_dir, loader, host='google.com', port=443)
def test_gabbits():
test_dir = os.path.join(os.path.dirname(__file__), TESTS_DIR)
# Pass "require_ssl=True" as an argument to force all tests
# to use SSL in requests.
test_generator = driver.py_test_generator(
test_dir, intercept=wsgiapp.app,
fixture_module=fixtures)
for test in test_generator:
yield test
def load_tests(loader, tests, pattern):
"""Provide a TestSuite to the discovery process."""
test_dir = os.path.join(os.path.dirname(__file__), TESTS_DIR)
# Pass "require_ssl=True" as an argument to force all tests
# to use SSL in requests.
return driver.build_tests(test_dir, loader,
intercept=wsgiapp.app,
fixture_module=fixtures)