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

def setUp(self):

    self.hass = get_test_home_assistant()
    self.scanner = loader.get_component('device_tracker.test').get_scanner(None, None)
    self.scanner.reset()
    self.scanner.come_home('DEV1')
    loader.get_component('light.test').init()
    with patch('homeassistant.components.device_tracker.load_yaml_config_file', return_value={'device_1': {'hide_if_away': False, 'mac': 'DEV1', 'name': 'Unnamed    Device', 'picture': 'http://example.com/dev1.jpg', 'track': True, 'vendor': None}, 'device_2': {'hide_if_away': False, 'mac': 'DEV2', 'name': 'Unnamed    Device', 'picture': 'http://example.com/dev2.jpg', 'track': True, 'vendor': None}}):
        self.assertTrue(setup_component(self.hass, device_tracker.DOMAIN, {device_tracker.DOMAIN: {CONF_PLATFORM: 'test'}}))
    self.assertTrue(setup_component(self.hass, light.DOMAIN, {light.DOMAIN: {CONF_PLATFORM: 'test'}}))
