#NEWLINE# @ patch ( 'bokeh.io.push' ) #NEWLINE# def test( self , mock_push ) : #NEWLINE# #INDENT# s = io . State ( ) #NEWLINE# s . _session_coords = _SessionCoordinates ( dict ( session_id = 'thesession' , url = 'http://example.com' , app_path = '/foo' ) ) #NEWLINE# s . _server_enabled = True #NEWLINE# controller = Mock ( ) #NEWLINE# io . _show_server_with_state ( 'obj' , s , 'window' , controller ) #NEWLINE# self . _check_func_called ( mock_push , ( ) , { #NEWLINE# #INDENT# 'state' : s , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . _check_func_called ( controller . open , ( 'http://example.com/foo?bokeh-session-id=thesession' , ) , { #NEWLINE# #INDENT# 'new' : 1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# io . _show_server_with_state ( 'obj' , s , 'tab' , controller ) #NEWLINE# self . _check_func_called ( mock_push , ( ) , { #NEWLINE# #INDENT# 'state' : s , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . _check_func_called ( controller . open , ( 'http://example.com/foo?bokeh-session-id=thesession' , ) , { #NEWLINE# #INDENT# 'new' : 2 , #NEWLINE# #UNINDENT# } )