#NEWLINE# def test_destroyAllCircuits_with_streams( self ) : #NEWLINE# #INDENT# mock_stream = mock . Mock ( ) #NEWLINE# self . cm . _pending_stream_list = [ mock_stream ] #NEWLINE# mock_open_circuit = mock . Mock ( ) #NEWLINE# self . cm . _open_circuit_dict = { #NEWLINE# #INDENT# 1 : mock_open_circuit , #NEWLINE# #UNINDENT# } #NEWLINE# mock_circuit_build_task = mock . Mock ( ) #NEWLINE# self . cm . _circuit_build_task_dict = { #NEWLINE# #INDENT# 2 : mock_circuit_build_task , #NEWLINE# #UNINDENT# } #NEWLINE# self . cm . destroyAllCircuits ( ) #NEWLINE# self . assertEqual ( len ( self . cm . _pending_stream_list ) , 0 ) #NEWLINE# self . assertEqual ( self . destroyCircuitFromManager . call_count , 1 ) #NEWLINE# self . assertEqual ( mock_circuit_build_task . destroyCircuitFromManager . call_count , 1 )