def testSensorCallback(self):
    debug('testSensorCallback')
    self.previousSystemData = None
    self.currentSystemData = None
    self.done = False
    SensorsClientTest.client.SetDataChanged(self.OnDataChanged)
    actuator_channel = GPIO().pins[10]
    sensor_channel = GPIO().pins[11]
    sensors = {'actuator': {'description': 'Digital Output', 'device': 'DigitalActuator', 'args': {'gpio': 'GPIO', 'invert': False, 'channel': actuator_channel}, 'name': 'test_actuator'}, 'sensor': {'description': 'Digital Input', 'device': 'DigitalSensor', 'args': {'gpio': 'GPIO', 'invert': False, 'channel': sensor_channel}, 'name': 'testdevice'}}
    for sensor in sensors.values():
        SensorsClientTest.client.AddSensor(sensor['name'], sensor['description'], sensor['device'], sensor['args'])
    for i in range(35):
        sleep(1)
        if self.done:
            break
    info('Changed items: {}'.format([x for x in self.currentSystemData if (x not in self.previousSystemData)]))
    self.assertNotEqual(self.previousSystemData, self.currentSystemData)
    for sensor in sensors.values():
        self.assertTrue(SensorsClientTest.client.RemoveSensor(sensor['name']))
def testSensorCallback(self):
    debug('testSensorCallback')
    self.previousSystemData = None
    self.currentSystemData = None
    self.done = False
    SensorsClientTest.client.SetDataChanged(self.OnDataChanged)
    actuator_channel = GPIO().pins[10]
    sensor_channel = GPIO().pins[11]
    sensors = {'actuator': {'description': 'Digital Output', 'device': 'DigitalActuator', 'args': {'gpio': 'GPIO', 'invert': False, 'channel': actuator_channel}, 'name': 'test_actuator'}, 'sensor': {'description': 'Digital Input', 'device': 'DigitalSensor', 'args': {'gpio': 'GPIO', 'invert': False, 'channel': sensor_channel}, 'name': 'testdevice'}}
    for sensor in sensors.values():
        SensorsClientTest.client.AddSensor(sensor['name'], sensor['description'], sensor['device'], sensor['args'])
    for i in range(35):
        sleep(1)
        if self.done:
            break
    info('Changed items: {}'.format([x for x in self.currentSystemData if (x not in self.previousSystemData)]))
    self.assertNotEqual(self.previousSystemData, self.currentSystemData)
    for sensor in sensors.values():
        self.assertTrue(SensorsClientTest.client.RemoveSensor(sensor['name']))