

def test__check_config_agents_auto_adds_new_cfg_agents(self):
    self._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, False]
        self.plugin._check_config_agents()
        self.assertEqual(len(self._agent_dict), len(self.plugin._cfg_agent_statuses))
        agent_ids = {attrs['id'] for attrs in self._agent_dict.values()}
        for (agent_id, info) in six.iteritems(self.plugin._cfg_agent_statuses):
            self.assertIn(agent_id, agent_ids)

dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/tests/unit/cisco/device_manager/test_hosting_device_cfg_agent_scheduler.py HostingDeviceConfigAgentSchedulerTestCase.test__check_config_agents_auto_adds_new_cfg_agents/original