def test_app_dir_shadowing(self): app_dir = self.tempdir() sys_dir = self.app_dir if os.path.exists(sys_dir): os.removedirs(sys_dir) install_extension(self.source_dir) sys_path = pjoin(sys_dir, 'extensions', '*python-tests*.tgz') assert glob.glob(sys_path) app_path = pjoin(app_dir, 'extensions', '*python-tests*.tgz') assert not glob.glob(app_path) assert '@quantlab/python-tests' in _get_extensions(app_dir) install_extension(self.source_dir, app_dir) assert glob.glob(app_path) assert '@quantlab/python-tests' in _get_extensions(app_dir) uninstall_extension('@quantlab/python-tests', app_dir) assert not glob.glob(app_path) assert glob.glob(sys_path) assert '@quantlab/python-tests' in _get_extensions(app_dir) uninstall_extension('@quantlab/python-tests', app_dir) assert not glob.glob(app_path) assert not glob.glob(sys_path) assert '@quantlab/python-tests' not in _get_extensions(app_dir)
def test_install_mime_renderer(self): install_extension(self.mime_renderer_dir) assert '@quantlab/mime-extension-test' in _get_extensions(self.app_dir) uninstall_extension('@quantlab/mime-extension-test') assert '@quantlab/mime-extension-test' not in _get_extensions( self.app_dir)
def test_should_build(self): assert not should_build()[0] install_extension(self.source_dir) assert should_build()[0] build() assert not should_build()[0] uninstall_extension('@quantlab/python-tests') assert should_build()[0]
def test_uninstall_core_extension(self): uninstall_extension('@quantlab/console-extension') app_dir = self.app_dir _ensure_package(app_dir) with open(pjoin(app_dir, 'staging', 'package.json')) as fid: data = json.load(fid) extensions = data['quantlab']['extensions'] assert '@quantlab/console-extension' not in extensions install_extension('@quantlab/console-extension') _ensure_package(app_dir) with open(pjoin(app_dir, 'staging', 'package.json')) as fid: data = json.load(fid) extensions = data['quantlab']['extensions'] assert '@quantlab/console-extension' in extensions
def test_app_dir(self): app_dir = self.tempdir() install_extension(self.source_dir, app_dir) path = pjoin(app_dir, 'extensions', '*python-tests*.tgz') assert glob.glob(path) assert '@quantlab/python-tests' in _get_extensions(app_dir) uninstall_extension('@quantlab/python-tests', app_dir) path = pjoin(app_dir, 'extensions', '*python-tests*.tgz') assert not glob.glob(path) assert '@quantlab/python-tests' not in _get_extensions(app_dir) link_package(self.source_dir, app_dir) linked = _get_linked_packages(app_dir).keys() assert '@quantlab/python-tests' in linked unlink_package(self.source_dir, app_dir) linked = _get_linked_packages(app_dir).keys() assert '@quantlab/python-tests' not in linked
def test_uninstall_extension(self): install_extension(self.source_dir) uninstall_extension('@quantlab/python-tests') path = pjoin(self.app_dir, 'extensions', '*python_tests*.tgz') assert not glob.glob(path) assert '@quantlab/python-tests' not in _get_extensions(self.app_dir)