예제 #1
0
 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] == {}
예제 #2
0
 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] == {}
예제 #3
0
파일: test_showing.py 프로젝트: gully/bokeh
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] == {}
예제 #4
0
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] == {}
예제 #5
0
 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] == {}
예제 #6
0
 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] == {}