#NEWLINE# def _test_get_router_networks_twice_helper( self ) : #NEWLINE# #INDENT# router_id = 'router-id' #NEWLINE# ports = [ { #NEWLINE# #INDENT# 'network_id' : 'network_id1' , #NEWLINE# 'something' : 42 , #NEWLINE# #UNINDENT# } ] #NEWLINE# expected_networks = ( 'network_id1' , ) #NEWLINE# with mock . patch ( 'oslo_utils.timeutils.utcnow_ts' , return_value = 0 ) : #NEWLINE# #INDENT# mock_get_ports = networks . handler . plugin_rpc . get_ports #NEWLINE# mock_get_ports . return_value = ports #NEWLINE# networks = self . handler . _get_router_networks ( router_id ) #NEWLINE# mock_get_ports . assert_called_once_with ( mock . ANY , { #NEWLINE# #INDENT# 'device_id' : [ router_id ] , #NEWLINE# 'device_owner' : n_const . ROUTER_INTERFACE_OWNERS , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( expected_networks , networks ) #NEWLINE# networks = self . handler . _get_router_networks ( router_id )