'Test state gets updated when sensor returns a new status.'

def test_update_when_value_changed(self):

    self.rest.update = Mock('rest.RestData.update', side_effect=self.update_side_effect('{    "key":    "updated_state"    }'))
    self.sensor.update()
    self.assertEqual('updated_state', self.sensor.state)
