'Setup a platform.'

@patch('homeassistant.components.device_tracker.upc_connect.UPCDeviceScanner.async_scan_devices', return_value=async_scan_devices_mock)
def test_setup_platform(self, scan_mock, aioclient_mock):

    aioclient_mock.get('http://{}/common_page/login.html'.format(self.host), cookies={'sessionToken': '654321'})
    aioclient_mock.post('http://{}/xml/getter.xml'.format(self.host), content='successful')
    with assert_setup_component(1, DOMAIN):
        assert setup_component(self.hass, DOMAIN, {DOMAIN: {CONF_PLATFORM: 'upc_connect', CONF_HOST: self.host}})
    assert (len(aioclient_mock.mock_calls) == 1)
