def test_labextensionpy_disable(self): self._inject_mock_extension() install_labextension_python('mockextension', user=True) enable_labextension_python('mockextension') disable_labextension_python('mockextension', user=True) data = _read_config_data(user=True) config = data.get('LabApp', {}).get('labextensions', {}).get('mockextension', {}) assert not config['enabled']
def test_labextensionpy_disable(self): self._inject_mock_extension() install_labextension_python('mockextension', user=True) enable_labextension_python('mockextension') disable_labextension_python('mockextension', user=True) data = _read_config_data('labextensions', user=True) config = data.get('mockextension', {}) assert not config['enabled']
def test_labextensionpy_disable(self): self._inject_mock_extension() install_labextension_python('mockextension', user=True) enable_labextension_python('mockextension') disable_labextension_python('mockextension', user=True) config_dir = os.path.join(_get_config_dir(user=True), 'labconfig') cm = BaseJSONConfigManager(config_dir=config_dir) enabled = cm.get('jupyterlab_config').get('LabApp', {}).get('labextensions', {}).get('mockextension', False) assert not enabled
def test_get_labconfig(self): # enabled at sys level self._inject_mock_extension('mockext_sys') install_labextension_python('mockext_sys', user=False) # enabled at sys, disabled at user self._inject_mock_extension('mockext_both') install_labextension_python('mockext_both', user=False) install_labextension_python('mockext_both', user=True) # enabled at user self._inject_mock_extension('mockext_user') install_labextension_python('mockext_user', user=True) enable_labextension_python('mockext_sys', user=False) enable_labextension_python('mockext_user', user=True) enable_labextension_python('mockext_both', user=False) disable_labextension_python('mockext_both', user=True) app = NotebookApp() config = get_labconfig(app).get('labextensions') assert config['mockext_user']['enabled'] assert config['mockext_sys']['enabled'] assert not config['mockext_both']['enabled']
def test_get_labconfig(self): # enabled at sys level self._inject_mock_extension('mockext_sys') install_labextension_python('mockext_sys', user=False) # enabled at sys, disabled at user self._inject_mock_extension('mockext_both') install_labextension_python('mockext_both', user=False) install_labextension_python('mockext_both', user=True) # enabled at user self._inject_mock_extension('mockext_user') install_labextension_python('mockext_user', user=True) enable_labextension_python('mockext_sys', user=False) enable_labextension_python('mockext_user', user=True) enable_labextension_python('mockext_both', user=False) disable_labextension_python('mockext_both', user=True) app = NotebookApp() config = get_labconfig(app).get('labextensions') assert config['mockext_user']['enabled'] assert config['mockext_sys']['enabled'] assert not config['mockext_both']['enabled']