'Test update with target state.'

def test_update_with_target_state(self):

    self.switch._target_state = True
    self.port.data = {}
    self.port.data['output'] = 'stale'
    self.switch.update()
    self.assertEqual(1.0, self.port.data['output'])
    self.assertEqual(None, self.switch._target_state)
    self.port.data['output'] = 'untouched'
    self.switch.update()
    self.assertEqual('untouched', self.port.data['output'])
