#NEWLINE# @ patch ( 'ws4py.manager.SelectPoller' ) #NEWLINE# def test_websocket_close_all( self , MockSelectPoller ) : #NEWLINE# #INDENT# m = WebSocketManager ( poller = MockSelectPoller ( ) ) #NEWLINE# ws = MagicMock ( ) #NEWLINE# m . add ( ws ) #NEWLINE# m . close_all ( ) #NEWLINE# ws . close . assert_called_once_with ( code = 1001 , reason = 'Server is shutting down' )