mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Add test to check if serverextensions are installed
This commit is contained in:
@@ -2,6 +2,7 @@ import requests
|
||||
from hubtraf.user import User
|
||||
from hubtraf.auth.dummy import login_dummy
|
||||
import secrets
|
||||
import subprocess
|
||||
import pytest
|
||||
from functools import partial
|
||||
import asyncio
|
||||
@@ -104,4 +105,24 @@ async def test_user_admin_remove():
|
||||
await u.ensure_server()
|
||||
|
||||
# Assert that the user does *not* have admin rights
|
||||
assert f'jupyter-{username}' in grp.getgrnam('jupyterhub-admins').gr_mem
|
||||
assert f'jupyter-{username}' in grp.getgrnam('jupyterhub-admins').gr_mem
|
||||
|
||||
|
||||
def test_serverextensions():
|
||||
"""
|
||||
Validate serverextensions we want are installed
|
||||
"""
|
||||
proc = subprocess.run([
|
||||
'/opt/tljh/user/bin/jupyter-serverextensions',
|
||||
'list', '--sys-prefix'
|
||||
], capture_output=True, universal_newlines=True)
|
||||
|
||||
extensions = [
|
||||
'jupyterlab 0.32.1',
|
||||
'nbgitpuller 0.6.1',
|
||||
'nteract_on_jupyter 1.8.1',
|
||||
'nbresuse'
|
||||
]
|
||||
|
||||
for e in extensions:
|
||||
assert '{} ^[[32mOK^[[0m' in e.stderr
|
||||
|
||||
Reference in New Issue
Block a user