#NEWLINE# def test_handle_topology_change( self ) : #NEWLINE# #INDENT# event = { #NEWLINE# #INDENT# 'change_type' : 'NEW_NODE' , #NEWLINE# 'address' : ( '1.2.3.4' , 9000 ) , #NEWLINE# #UNINDENT# } #NEWLINE# self . cluster . scheduler . reset_mock ( ) #NEWLINE# self . control_connection . _handle_topology_change ( event ) #NEWLINE# self . cluster . scheduler . schedule_unique . assert_called_once_with ( ANY , self . control_connection . refresh_node_list_and_token_map ) #NEWLINE# event = { #NEWLINE# #INDENT# 'change_type' : 'REMOVED_NODE' , #NEWLINE# 'address' : ( '1.2.3.4' , 9000 ) , #NEWLINE# #UNINDENT# } #NEWLINE# self . cluster . scheduler . reset_mock ( ) #NEWLINE# self . control_connection . _handle_topology_change ( event ) #NEWLINE# self . cluster . scheduler . schedule_unique . assert_called_once_with ( ANY , self . cluster . remove_host , None ) #NEWLINE# event = { #NEWLINE# #INDENT# 'change_type' : 'MOVED_NODE' , #NEWLINE# 'address' : ( '1.2.3.4' , 9000 ) , #NEWLINE# #UNINDENT# } #NEWLINE# self . cluster . scheduler . reset_mock ( ) #NEWLINE# self . control_connection . _handle_topology_change ( self ) #NEWLINE# self . cluster . scheduler . schedule_unique . assert_called_once_with ( ANY , self . control_connection . refresh_node_list_and_token_map )