#NEWLINE# def test_refresh_disabled( self ) : #NEWLINE# #INDENT# cluster = MockCluster ( ) #NEWLINE# schema_event = { #NEWLINE# #INDENT# 'target_type' : SchemaTargetType . TABLE , #NEWLINE# 'change_type' : SchemaChangeType . CREATED , #NEWLINE# 'keyspace' : 'ks1' , #NEWLINE# 'table' : 'table1' , #NEWLINE# #UNINDENT# } #NEWLINE# status_event = { #NEWLINE# #INDENT# 'change_type' : 'UP' , #NEWLINE# 'address' : ( '1.2.3.4' , 9000 ) , #NEWLINE# #UNINDENT# } #NEWLINE# topo_event = { #NEWLINE# #INDENT# 'change_type' : 'MOVED_NODE' , #NEWLINE# 'address' : ( '1.2.3.4' , 9000 ) , #NEWLINE# #UNINDENT# } #NEWLINE# cc_no_schema_refresh = ControlConnection ( cluster , 1 , ( - 1 ) , 0 ) #NEWLINE# cluster . scheduler . reset_mock ( ) #NEWLINE# cc_no_schema_refresh . _handle_schema_change ( schema_event ) #NEWLINE# self . assertFalse ( cluster . scheduler . schedule . called ) #NEWLINE# self . assertFalse ( cluster . scheduler . schedule_unique . called ) #NEWLINE# cc_no_schema_refresh . _handle_status_change ( status_event ) #NEWLINE# cc_no_schema_refresh . _handle_topology_change ( topo_event ) #NEWLINE# cluster . scheduler . schedule_unique . assert_has_calls ( [ call ( ANY , cc_no_schema_refresh . refresh_node_list_and_token_map ) , call ( ANY , cc_no_schema_refresh . refresh_node_list_and_token_map ) ] ) #NEWLINE# cc_no_topo_refresh = ControlConnection ( cluster , 1 , 0 , ( - 1 ) ) #NEWLINE# cluster . scheduler . reset_mock ( ) #NEWLINE# cc_no_topo_refresh . _handle_topology_change ( topo_event ) #NEWLINE# self . assertFalse ( cluster . scheduler . schedule . called ) #NEWLINE# self . assertFalse ( cluster . scheduler . schedule_unique . called ) #NEWLINE# cc_no_topo_refresh . _handle_status_change ( status_event ) #NEWLINE# cc_no_topo_refresh . _handle_schema_change ( schema_event ) #NEWLINE# cluster . scheduler . schedule_unique . assert_has_calls ( [ call ( ANY , cc_no_topo_refresh . refresh_node_list_and_token_map ) , call ( 0.0 , cc_no_topo_refresh . refresh_schema , ** topo_event ) ] )