def test(self, mock_push): s = io.State() s._session = Mock() s._session.object_link.return_value = "link" controller = Mock() io._show_server_with_state("obj", s, "window", controller) self._check_func_called(mock_push, (), {"state": s}) self._check_func_called(controller.open, ("link",), {"new": 1}) io._show_server_with_state("obj", s, "tab", controller) self._check_func_called(mock_push, (), {"state": s}) self._check_func_called(controller.open, ("link",), {"new": 2})
def test(self, mock_push): s = io.State() s._session = Mock() s._session.object_link.return_value = "link" controller = Mock() io._show_server_with_state("obj", s, "window", controller) self._check_func_called(mock_push, (), {"state": s}) self._check_func_called(controller.open, ("link", ), {"new": 1}) io._show_server_with_state("obj", s, "tab", controller) self._check_func_called(mock_push, (), {"state": s}) self._check_func_called(controller.open, ("link", ), {"new": 2})
def test(self, mock_push): s = io.State() s._session_id = "thesession" s._server_url = "http://example.com" controller = Mock() io._show_server_with_state("obj", s, "window", controller) self._check_func_called(mock_push, (), {"state": s}) self._check_func_called(controller.open, ("http://example.com?bokeh-session-id=thesession",), {"new": 1}) io._show_server_with_state("obj", s, "tab", controller) self._check_func_called(mock_push, (), {"state": s}) self._check_func_called(controller.open, ("http://example.com?bokeh-session-id=thesession",), {"new": 2})
def test(self, mock_push): s = io.State() s._session_coords = _SessionCoordinates(dict(session_id="thesession", url="http://example.com", app_path='/foo')) s._server_enabled = True controller = Mock() io._show_server_with_state("obj", s, "window", controller) self._check_func_called(mock_push, (), {"state": s}) self._check_func_called(controller.open, ("http://example.com/foo?bokeh-session-id=thesession",), {"new": 1}) io._show_server_with_state("obj", s, "tab", controller) self._check_func_called(mock_push, (), {"state": s}) self._check_func_called(controller.open, ("http://example.com/foo?bokeh-session-id=thesession",), {"new": 2})
def test(self, mock_push): s = io.State() s._session_coords = _SessionCoordinates( dict(session_id="thesession", url="http://example.com", app_path='/foo')) s._server_enabled = True controller = Mock() io._show_server_with_state("obj", s, "window", controller) self._check_func_called(mock_push, (), {"state": s}) self._check_func_called( controller.open, ("http://example.com/foo?bokeh-session-id=thesession", ), {"new": 1}) io._show_server_with_state("obj", s, "tab", controller) self._check_func_called(mock_push, (), {"state": s}) self._check_func_called( controller.open, ("http://example.com/foo?bokeh-session-id=thesession", ), {"new": 2})