def test_enable_extension(self): app_dir = self.tempdir() install_extension(self.source_dir, app_dir) disable_extension('@jupyterlab/python-tests', app_dir) enable_extension('@jupyterlab/python-tests', app_dir) disabled = _get_disabled(app_dir) assert '@jupyterlab/python-tests' not in disabled
def test_disable_extension(self): app_dir = self.tempdir() install_extension(self.mock_extension, app_dir) disable_extension('@jupyterlab/python-tests', app_dir) disabled = _get_disabled(app_dir) assert '@jupyterlab/python-tests' in disabled disable_extension('@jupyterlab/notebook-extension', app_dir) disabled = _get_disabled(app_dir) assert '@jupyterlab/notebook-extension' in disabled
def test_enable_extension(self): app_dir = self.tempdir() install_extension(self.mock_extension, app_dir) disable_extension(self.pkg_names['extension'], app_dir) enable_extension(self.pkg_names['extension'], app_dir) info = get_app_info(app_dir) assert self.pkg_names['extension'] not in info['disabled'] disable_extension('@jupyterlab/notebook-extension', app_dir) assert self.pkg_names['extension'] not in info['disabled'] assert '@jupyterlab/notebook-extension' not in info['disabled']
def test_enable_extension(self): options = AppOptions(app_dir=self.tempdir()) assert install_extension(self.mock_extension, app_options=options) is True assert disable_extension(self.pkg_names['extension'], app_options=options) is True assert enable_extension(self.pkg_names['extension'], app_options=options) is True info = get_app_info(app_options=options) assert '@jupyterlab/notebook-extension' not in info['disabled'] name = self.pkg_names['extension'] assert info['disabled'].get(name, False) is False assert check_extension(name, app_options=options) assert disable_extension('@jupyterlab/notebook-extension', app_options=options) is True assert check_extension(name, app_options=options) assert not check_extension('@jupyterlab/notebook-extension', app_options=options)
def test_enable_extension(self): app_dir = self.tempdir() assert install_extension(self.mock_extension, app_dir) is True assert disable_extension(self.pkg_names['extension'], app_dir) is True assert enable_extension(self.pkg_names['extension'], app_dir) is True info = get_app_info(app_dir) name = self.pkg_names['extension'] assert name not in info['disabled'] assert check_extension(name, app_dir) assert disable_extension('@jupyterlab/notebook-extension', app_dir) is True assert name not in info['disabled'] assert check_extension(name, app_dir) assert '@jupyterlab/notebook-extension' not in info['disabled'] assert not check_extension('@jupyterlab/notebook-extension', app_dir)
def test_disable_extension(self): options = AppOptions(app_dir=self.tempdir()) assert install_extension(self.mock_extension, app_options=options) is True assert disable_extension(self.pkg_names["extension"], app_options=options) is True info = get_app_info(app_options=options) name = self.pkg_names["extension"] assert info["disabled"].get(name) is True assert not check_extension(name, app_options=options) assert check_extension(name, installed=True, app_options=options) assert disable_extension("@jupyterlab/notebook-extension", app_options=options) is True info = get_app_info(app_options=options) assert info["disabled"].get("@jupyterlab/notebook-extension") is True assert not check_extension("@jupyterlab/notebook-extension", app_options=options) assert check_extension("@jupyterlab/notebook-extension", installed=True, app_options=options) assert info["disabled"].get(name) is True assert not check_extension(name, app_options=options) assert check_extension(name, installed=True, app_options=options)
def disable(self, extension): """Handle a disable request""" disable_extension(extension, app_dir=self.app_dir, logger=self.log) raise gen.Return(dict(status='ok',))