Example #1
0
async def fake_async_home(fake_cloud, event_loop):
    home = AsyncHome(event_loop)
    with no_ssl_verification():
        lookup_url = "{}/getHost".format(fake_cloud.url)
        #    home.download_configuration = fake_home_download_configuration
        home._connection = AsyncConnection(event_loop)
        home._fake_cloud = fake_cloud
        home.set_auth_token(
            "8A45BAA53BE37E3FCA58E9976EFA4C497DAFE55DB997DB9FD685236E5E63ED7DE"
        )
        await home._connection.init(accesspoint_id="3014F711A000000BAD0C0DED",
                                    lookup_url=lookup_url)
        await home.get_current_state()
    yield home
async def no_ssl_fake_async_home(fake_cloud, event_loop):
    home = AsyncHome(event_loop)
    home._connection._websession.post = partial(
        home._connection._websession.post, ssl=False)

    lookup_url = "{}/getHost".format(fake_cloud.url)
    home._fake_cloud = fake_cloud
    home.set_auth_token(
        "8A45BAA53BE37E3FCA58E9976EFA4C497DAFE55DB997DB9FD685236E5E63ED7DE")
    await home._connection.init(accesspoint_id="3014F711A000000BAD0C0DED",
                                lookup_url=lookup_url)
    await home.get_current_state()

    yield home

    await home._connection._websession.close()