mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-13 04:53:01 +00:00
Central internal_ssl switch
This commit is contained in:
@@ -74,7 +74,9 @@ def ssl_tmpdir(tmpdir_factory):
|
|||||||
def app(request, io_loop, ssl_tmpdir):
|
def app(request, io_loop, ssl_tmpdir):
|
||||||
"""Mock a jupyterhub app for testing"""
|
"""Mock a jupyterhub app for testing"""
|
||||||
mocked_app = None
|
mocked_app = None
|
||||||
ssl_enabled = getattr(request.module, "ssl_enabled", False)
|
ssl_enabled = request.module.getattr(
|
||||||
|
'ssl_enabled', os.environ.get('SSL_ENABLED', False)
|
||||||
|
)
|
||||||
kwargs = dict()
|
kwargs = dict()
|
||||||
if ssl_enabled:
|
if ssl_enabled:
|
||||||
kwargs.update(dict(internal_ssl=True, internal_certs_location=str(ssl_tmpdir)))
|
kwargs.update(dict(internal_ssl=True, internal_certs_location=str(ssl_tmpdir)))
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
"""Tests for the REST API."""
|
"""Tests for the REST API."""
|
||||||
import json
|
import json
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import uuid
|
import uuid
|
||||||
@@ -28,7 +27,6 @@ from .utils import async_requests
|
|||||||
from .utils import auth_header
|
from .utils import auth_header
|
||||||
from .utils import find_user
|
from .utils import find_user
|
||||||
|
|
||||||
ssl_enabled = os.environ.get('SSL_ENABLED', False)
|
|
||||||
# --------------------
|
# --------------------
|
||||||
# Authentication tests
|
# Authentication tests
|
||||||
# --------------------
|
# --------------------
|
||||||
|
@@ -20,8 +20,6 @@ from ..app import JupyterHub
|
|||||||
from .mocking import MockHub
|
from .mocking import MockHub
|
||||||
from .test_api import add_user
|
from .test_api import add_user
|
||||||
|
|
||||||
ssl_enabled = os.environ.get('SSL_ENABLED', False)
|
|
||||||
|
|
||||||
|
|
||||||
def test_help_all():
|
def test_help_all():
|
||||||
out = check_output([sys.executable, '-m', 'jupyterhub', '--help-all']).decode(
|
out = check_output([sys.executable, '-m', 'jupyterhub', '--help-all']).decode(
|
||||||
|
@@ -42,8 +42,6 @@ while True:
|
|||||||
print("interrupted")
|
print("interrupted")
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ssl_enabled = os.environ.get('SSL_ENABLED', False)
|
|
||||||
|
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
Reference in New Issue
Block a user