Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Nov 28, 2023
1 parent ddfd913 commit 2c968ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tljh-plasma/tljh_plasma/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from jupyterhub.apihandlers import APIHandler
from jupyterhub.handlers.base import BaseHandler
from jupyterhub.orm import Base, Column, Integer, Unicode
from jupyterhub.utils import admin_only
from jupyterhub.scopes import needs_scope
from tljh_repo2docker.docker import list_images
from tornado.web import authenticated

Expand All @@ -32,7 +32,7 @@ class PermissionsHandler(BaseHandler):
"""

@authenticated
@admin_only
@needs_scope("admin-ui")
async def get(self):
include_groups = self.settings.get("include_groups")
all_groups = list_groups(include_groups)
Expand Down Expand Up @@ -60,8 +60,8 @@ class PermissionsAPIHandler(APIHandler):
Handle edits to the mapping of environments and groups.
"""

@admin_only
@authenticated
@needs_scope("admin-ui")
async def post(self):
raw_args = self.request.body.decode("utf-8")
args = json.loads(raw_args)
Expand Down
9 changes: 3 additions & 6 deletions tljh-plasma/tljh_plasma/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import asyncio
import os
import sys

import pytest

from jupyterhub.tests.mocking import MockPAMAuthenticator
from tljh_repo2docker.tests.conftest import (
minimal_repo,
image_name,
generated_image_name,
remove_all_test_images
)
from tljh_repo2docker.tests.utils import add_environment
from tljh_repo2docker import tljh_custom_jupyterhub_config as tljh_repo2docker_config
from tljh_plasma import tljh_custom_jupyterhub_config as tljh_plasma_config
from traitlets.config import Config
Expand All @@ -19,10 +15,11 @@
@pytest.fixture
async def app(hub_app):
config = Config()
config.authenticator_class = 'jupyterhub.tests.mocking.MockPAMAuthenticator'

tljh_repo2docker_config(config)
tljh_plasma_config(config)

config.JupyterHub.authenticator_class = MockPAMAuthenticator

app = await hub_app(config=config)
return app

0 comments on commit 2c968ec

Please sign in to comment.