1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Migrate Mailgun to use the webhook component (#17464)

* Switch mailgun to use webhook api

* Generalize webhook_config_entry_flow

* Add tests for webhook_config_entry_flow

* Add tests for mailgun

* Remove old mailgun file from .coveragerc

* Refactor WebhookFlowHandler into config_entry_flow

* Remove test of helper func from IFTTT

* Lint
This commit is contained in:
Rohan Kapoor
2018-10-23 02:14:46 -07:00
committed by Paulus Schoutsen
parent 277a9a3995
commit d5a5695411
13 changed files with 289 additions and 122 deletions

View File

@@ -1,5 +1,5 @@
"""Test the init file of IFTTT."""
from unittest.mock import Mock, patch
from unittest.mock import patch
from homeassistant import data_entry_flow
from homeassistant.core import callback
@@ -36,13 +36,3 @@ async def test_config_flow_registers_webhook(hass, aiohttp_client):
assert len(ifttt_events) == 1
assert ifttt_events[0].data['webhook_id'] == webhook_id
assert ifttt_events[0].data['hello'] == 'ifttt'
async def test_config_flow_aborts_external_url(hass, aiohttp_client):
"""Test setting up IFTTT and sending webhook."""
hass.config.api = Mock(base_url='http://192.168.1.10')
result = await hass.config_entries.flow.async_init('ifttt', context={
'source': 'user'
})
assert result['type'] == data_entry_flow.RESULT_TYPE_ABORT
assert result['reason'] == 'not_internet_accessible'