Skip to content

Commit

Permalink
Provide runTest for tornado 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jwindgassen committed Nov 15, 2024
1 parent 1be3c06 commit 1f8855b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/test_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path

import pytest
from tornado.testing import AsyncHTTPTestCase
from tornado import testing

from jupyter_server_proxy.standalone import _default_address_and_port, make_proxy_app

Expand Down Expand Up @@ -57,12 +57,14 @@ def make_app(unix_socket: bool, skip_authentication: bool):
)


class TestStandaloneProxyRedirect(AsyncHTTPTestCase):
class TestStandaloneProxyRedirect(testing.AsyncHTTPTestCase):
"""
Ensure requests are proxied to the application. We need to disable authentication here,
as we do not want to be redirected to the JupyterHub Login.
"""

runTest = None # Required for Tornado 6.1

def get_app(self):
return make_app(False, True)

Expand Down Expand Up @@ -90,7 +92,9 @@ def test_on_prefix(self):
@pytest.mark.skipif(
sys.platform == "win32", reason="Unix socket not supported on Windows"
)
class TestStandaloneProxyWithUnixSocket(AsyncHTTPTestCase):
class TestStandaloneProxyWithUnixSocket(testing.AsyncHTTPTestCase):
runTest = None # Required for Tornado 6.1

def get_app(self):
return make_app(True, True)

Expand All @@ -104,11 +108,13 @@ def test_with_unix_socket(self):
assert "X-Proxycontextpath: /some/prefix/" in body


class TestStandaloneProxyLogin(AsyncHTTPTestCase):
class TestStandaloneProxyLogin(testing.AsyncHTTPTestCase):
"""
Ensure we redirect to JupyterHub login when authentication is enabled
"""

runTest = None # Required for Tornado 6.1

def get_app(self):
return make_app(False, False)

Expand Down

0 comments on commit 1f8855b

Please sign in to comment.