def multiple_views(build_path, monkeypatch): """Create multiple views app.""" monkeypatch.setattr(App, '_sourcefile', lambda self: 'bowtie.tests.test_multiple') app = App() view1 = View() # pylint: disable=unused-variable assert view1._uuid == 2 # pylint: disable=protected-access view2 = View() view2.add(table) app.add_route(view2, 'view2') app.add(table) app.add_sidebar(ctrl) app.add_sidebar(ctrl2) app.subscribe(callback, ctrl.on_change) app.subscribe(callback, ctrl2.on_click) app._build() # pylint: disable=protected-access env['PYTHONPATH'] = '{}:{}'.format(os.getcwd(), os.environ.get('PYTHONPATH', '')) server = subprocess.Popen(os.path.join(build_path, 'src/server.py'), env=env) time.sleep(5) yield server.kill()
def multiple_views(build_reset, monkeypatch): """Create multiple views app.""" app = App(__name__, sidebar=True) view1 = View() # pylint: disable=unused-variable assert view1._uuid == 2 # pylint: disable=protected-access view2 = View() view2.add(table) app.add_route(view2, 'view2') app.add(table) app.add_sidebar(ctrl) app.add_sidebar(ctrl2) app.subscribe(ctrl.on_change)(app.subscribe(ctrl2.on_click)(callback)) app._build() # pylint: disable=protected-access with server_check(app) as server: yield server
def multiple_views(build_reset, monkeypatch): """Create multiple views app.""" app = App(__name__, sidebar=True) view1 = View() # pylint: disable=unused-variable assert view1._uuid == 2 # pylint: disable=protected-access view2 = View() view2.add(table) app.add_route(view2, 'view2') app.add(table) app.add_sidebar(ctrl) app.add_sidebar(ctrl2) app.subscribe(ctrl.on_change)(app.subscribe(ctrl2.on_click)(callback)) app._build() # pylint: disable=protected-access with server_check(app) as server: yield server