'Setup things to be run when tests are started.'

def setUp(self):

    self.hass = get_test_home_assistant()
    self.initial_state = 'initial_state'
    self.rest = Mock('rest.RestData')
    self.rest.update = Mock('rest.RestData.update', side_effect=self.update_side_effect((('{    "key":    "' + self.initial_state) + '"    }')))
    self.name = 'foo'
    self.unit_of_measurement = 'MB'
    self.value_template = template('{{    value_json.key    }}')
    self.value_template.hass = self.hass
    self.sensor = rest.RestSensor(self.hass, self.rest, self.name, self.unit_of_measurement, self.value_template)
