'Check that dvr router is not removed from dvr_snat l3 agents
on router interface removal'

def test_router_is_not_removed_from_snat_agent_on_interface_removal(self):

    router = self._create_router(distributed=True, ha=True)
    kwargs = {'arg_list': (external_net.EXTERNAL,), external_net.EXTERNAL: True}
    with self.subnet() as subnet:
        with self.network(**kwargs) as ext_net:
            with self.subnet(network=ext_net, cidr='20.0.0.0/24'):
                gw_info = {'network_id': ext_net['network']['id']}
                self.l3_plugin.update_router(self.context, router['id'], {'router': {l3.EXTERNAL_GW_INFO: gw_info}})
                self.l3_plugin.add_router_interface(self.context, router['id'], {'subnet_id': subnet['subnet']['id']})
                self._assert_router_is_hosted_on_both_dvr_snat_agents(router)
                with mock.patch.object(self.l3_plugin, '_l3_rpc_notifier') as l3_notifier:
                    self.l3_plugin.remove_router_interface(self.context, router['id'], {'subnet_id': subnet['subnet']['id']})
                    self._assert_router_is_hosted_on_both_dvr_snat_agents(router)
                    self.assertFalse(l3_notifier.router_removed_from_agent.called)
