

def test__check_config_agents_dead_cfg_agent_triggers_hd_rescheduling(self):
    resched_mock._setup_cfg_agents()
    with mock.patch('networking_cisco.plugins.cisco.db.scheduler.cfg_agentschedulers_db.timeutils.is_older_than') as is_older_mock:
        is_older_mock.side_effect = [False, True, True, True]
        with mock.patch('networking_cisco.plugins.cisco.db.scheduler.cfg_agentschedulers_db.CfgAgentSchedulerDbMixin._reschedule_hosting_devices') as resched_mock:
            self.plugin._check_config_agents()
            self.assertEqual(1, len(self.plugin._cfg_agent_statuses))
            agent_id = list(self._agent_dict.values())[0]['id']
            self.assertEqual(list(self.plugin._cfg_agent_statuses.keys())[0], agent_id)
            resched_mock.assert_called_once_with(mock.ANY, agent_id)

dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/tests/unit/cisco/device_manager/test_hosting_device_cfg_agent_scheduler.py HostingDeviceConfigAgentSchedulerTestCase.test__check_config_agents_dead_cfg_agent_triggers_hd_rescheduling/VarMisuse@10/26 `self`->`resched_mock`