#NEWLINE# def test_list_l3_agents_hosting_ha_router( self ) : #NEWLINE# #INDENT# router = self . _create_ha_router ( ) #NEWLINE# agents = self . plugin . list_l3_agents_hosting_router ( self . adminContext , router [ 'id' ] ) [ 'agents' ] #NEWLINE# for agent in agents : #NEWLINE# #INDENT# self . assertEqual ( 'standby' , agent [ 'ha_state' ] ) #NEWLINE# #UNINDENT# self . plugin . update_routers_states ( self . adminContext , { #NEWLINE# #INDENT# router [ 'id' ] : 'active' , #NEWLINE# #UNINDENT# } , self . agent1 . host ) #NEWLINE# agents = self . plugin . list_l3_agents_hosting_router ( self . adminContext , router [ 'id' ] ) [ 'agents' ] #NEWLINE# for agent in agents : #NEWLINE# #INDENT# expected_state = ( 'active' if ( agent [ 'host' ] == self . agent1 . host ) else 'standby' ) #NEWLINE# self . assertEqual ( expected_state , agent [ 'ha_state' ] )