From a8e6165fa5af11e19783b8a10bd8e1eaf159cca0 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Sat, 4 Aug 2018 10:11:20 -0700 Subject: [PATCH] Add test to check if serverextensions are installed --- integration-tests/test_hub.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/integration-tests/test_hub.py b/integration-tests/test_hub.py index a70028a..95cb65c 100644 --- a/integration-tests/test_hub.py +++ b/integration-tests/test_hub.py @@ -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 \ No newline at end of file + 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