def testSensors(self):
    debug('testSensors')
    channel = GPIO().pins[8]
    testSensor = {'description': 'Digital Input', 'device': 'DigitalSensor', 'args': {'gpio': 'GPIO', 'invert': False, 'channel': channel}, 'name': 'testdevice'}
    SensorsClientTest.client.RemoveSensor(testSensor['name'])
    compareKeys = ('args', 'description', 'device')
    retValue = SensorsClientTest.client.AddSensor(testSensor['name'], testSensor['description'], testSensor['device'], testSensor['args'])
    self.assertTrue(retValue)
    retrievedSensor = next((obj for obj in manager.getDeviceList() if (obj['name'] == testSensor['name'])))
    for key in compareKeys:
        self.assertEqual(testSensor[key], retrievedSensor[key])
    editedSensor = testSensor
    editedSensor['args']['channel'] = GPIO().pins[5]
    retValue = SensorsClientTest.client.EditSensor(editedSensor['name'], editedSensor['description'], editedSensor['device'], editedSensor['args'])
    self.assertTrue(retValue)
    retrievedSensor = next((obj for obj in manager.getDeviceList() if (obj['name'] == editedSensor['name'])))
    for key in compareKeys:
        self.assertEqual(editedSensor[key], retrievedSensor[key])
    retValue = SensorsClientTest.client.RemoveSensor(testSensor['name'])
    self.assertTrue(retValue)
    deviceNames = [device['name'] for device in manager.getDeviceList()]
    self.assertNotIn(testSensor['name'], deviceNames)
def testSensors(self):
    debug('testSensors')
    channel = GPIO().pins[8]
    testSensor = {'description': 'Digital Input', 'device': 'DigitalSensor', 'args': {'gpio': 'GPIO', 'invert': False, 'channel': channel}, 'name': 'testdevice'}
    SensorsClientTest.client.RemoveSensor(testSensor['name'])
    compareKeys = ('args', 'description', 'device')
    retValue = SensorsClientTest.client.AddSensor(testSensor['name'], testSensor['description'], testSensor['device'], testSensor['args'])
    self.assertTrue(retValue)
    retrievedSensor = next((obj for obj in manager.getDeviceList() if (obj['name'] == testSensor['name'])))
    for key in compareKeys:
        self.assertEqual(testSensor[key], retrievedSensor[key])
    editedSensor = testSensor
    editedSensor['args']['channel'] = GPIO().pins[5]
    retValue = SensorsClientTest.client.EditSensor(editedSensor['name'], editedSensor['description'], editedSensor['device'], editedSensor['args'])
    self.assertTrue(retValue)
    retrievedSensor = next((obj for obj in manager.getDeviceList() if (obj['name'] == editedSensor['name'])))
    for key in compareKeys:
        self.assertEqual(editedSensor[key], retrievedSensor[key])
    retValue = SensorsClientTest.client.RemoveSensor(testSensor['name'])
    self.assertTrue(retValue)
    deviceNames = [device['name'] for device in manager.getDeviceList()]
    self.assertNotIn(testSensor['name'], deviceNames)