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

def setup_method(self):

    self.hass = get_test_home_assistant()
    config = {ip.DOMAIN: {'platform': 'demo'}, 'camera': {'platform': 'demo'}}
    with patch('homeassistant.components.image_processing.demo.DemoImageProcessingAlpr.should_poll', new_callable=PropertyMock(return_value=False)):
        setup_component(self.hass, ip.DOMAIN, config)
    state = self.hass.states.get('camera.demo_camera')
    self.url = '{0}{1}'.format(self.hass.config.api.base_url, state.attributes.get(ATTR_ENTITY_PICTURE))
    self.alpr_events = []
    @callback
    def mock_alpr_event(event):
        'Mock    event.'
        self.alpr_events.append(event)
    self.hass.bus.listen('image_processing.found_plate', mock_alpr_event)
