

def _expected_devices_events(self, devices, state):
    'Helper to check that events are received for expected devices.\n\n        :param devices: The list of expected devices. WARNING: This list\n          is modified by this method\n        :param state: The state of the devices (added or removed)\n        '
    events = self.monitor.get_events()
    event_devices = [(dev['name'], dev['external_ids']) for dev in events.get(state)]
    for dev in event_devices:
        if (dev[0] in devices):
            devices.remove(dev[0])
            self.assertEqual(dev[1].get('iface-status'), 'active')
        if (not devices):
            return True

dataset/ETHPy150Open openstack/neutron/neutron/tests/functional/agent/linux/test_ovsdb_monitor.py TestSimpleInterfaceMonitor._expected_devices_events/original