def app_fixture(hass, config_file): """Fixture for a single app.""" app = Mock(AppEntity) app.app_name = APP_NAME_PREFIX + str(uuid4()) app.app_id = str(uuid4()) app.app_type = "WEBHOOK_SMART_APP" app.classifications = [CLASSIFICATION_AUTOMATION] app.display_name = "Home Assistant" app.description = hass.config.location_name + " at " + hass.config.api.base_url app.single_instance = True app.webhook_target_url = webhook.async_generate_url( hass, hass.data[DOMAIN][CONF_WEBHOOK_ID]) settings = Mock(AppSettings) settings.app_id = app.app_id settings.settings = {SETTINGS_INSTANCE_ID: config_file[CONF_INSTANCE_ID]} app.settings.return_value = settings return app