def test_get_router_cidrs_no_device_exists(self):
    router = mock.MagicMock()
    router.get.return_value = [{'host': HOSTNAME}, {'host': mock.sentinel.otherhost}]
    ri = self._create_router(router)
    fake_fip_ns = mock.Mock(return_value=True)
    fake_fip_ns.get_name = mock.Mock(return_value=None)
    fake_fip_ns.get_int_device_name = mock.Mock(return_value=None)
    ri.fip_ns = fake_fip_ns
    device = mock.Mock()
    device.exists = mock.Mock(return_value=False)
    with mock.patch.object(ip_lib, 'IPDevice', return_value=device):
        self.assertFalse(ri.get_router_cidrs(device))
def test_get_router_cidrs_no_device_exists(self):
    router = mock.MagicMock()
    router.get.return_value = [{'host': HOSTNAME}, {'host': mock.sentinel.otherhost}]
    ri = self._create_router(router)
    fake_fip_ns = mock.Mock(return_value=True)
    fake_fip_ns.get_name = mock.Mock(return_value=None)
    fake_fip_ns.get_int_device_name = mock.Mock(return_value=None)
    ri.fip_ns = fake_fip_ns
    device = mock.Mock()
    device.exists = mock.Mock(return_value=False)
    with mock.patch.object(ip_lib, 'IPDevice', return_value=device):
        self.assertFalse(ri.get_router_cidrs(device))