def test_with_args(self, mock_run_notebook_hook): load_jupyter_args = (Resources(), True, True, 1000) bio.output_notebook(*load_jupyter_args) assert mock_run_notebook_hook.call_count == 1 assert mock_run_notebook_hook.call_args[0] == ( "jupyter", "load") + load_jupyter_args assert mock_run_notebook_hook.call_args[1] == {}
def test_no_args(self, mock_run_notebook_hook): default_load_jupyter_args = (None, False, False, 5000) bio.output_notebook() assert mock_run_notebook_hook.call_count == 1 assert mock_run_notebook_hook.call_args[0] == ( "jupyter", "load") + default_load_jupyter_args assert mock_run_notebook_hook.call_args[1] == {}
def test_show_with_app(mock_run_notebook_hook): curstate().reset() app = Application() output_notebook() bis.show(app, notebook_url="baz") assert curstate().notebook_type == "jupyter" assert mock_run_notebook_hook.call_count == 1 assert mock_run_notebook_hook.call_args[0][0] == curstate().notebook_type assert mock_run_notebook_hook.call_args[0][1:] == ("app", app, curstate(), "baz") assert mock_run_notebook_hook.call_args[1] == {}
def test_show_with_app(mock_run_notebook_hook): curstate().reset() app = Application() output_notebook() bis.show(app, notebook_url="baz") assert curstate().notebook_type == "jupyter" assert mock_run_notebook_hook.call_count == 1 assert mock_run_notebook_hook.call_args[0][0] == curstate().notebook_type assert mock_run_notebook_hook.call_args[0][1:] == ("app", app, curstate(), "baz") assert mock_run_notebook_hook.call_args[1] == {}
def test_with_args(self, mock_run_notebook_hook): load_jupyter_args = (Resources(), True, True, 1000) bio.output_notebook(*load_jupyter_args) assert mock_run_notebook_hook.call_count == 1 assert mock_run_notebook_hook.call_args[0] == ("jupyter", "load") + load_jupyter_args assert mock_run_notebook_hook.call_args[1] == {}
def test_no_args(self, mock_run_notebook_hook): default_load_jupyter_args = (None, False, False, 5000) bio.output_notebook() assert mock_run_notebook_hook.call_count == 1 assert mock_run_notebook_hook.call_args[0] == ("jupyter", "load") + default_load_jupyter_args assert mock_run_notebook_hook.call_args[1] == {}