How to use the pytile.errors.RequestError function in pytile

To help you get started, we’ve selected a few pytile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bachya / pytile / tests / test_client.py View on Github external
),
    )
    aresponses.add(
        "production.tile-api.com",
        f"/api/v1/clients/{TILE_CLIENT_UUID}/sessions",
        "post",
        aresponses.Response(text=json.dumps(fixture_create_session), status=200),
    )
    aresponses.add(
        "production.tile-api.com",
        "/api/v1/bad_endpoint",
        "get",
        aresponses.Response(text="", status=404),
    )

    with pytest.raises(RequestError):
        async with aiohttp.ClientSession() as session:
            client = await async_login(
                TILE_EMAIL, TILE_PASSWORD, client_uuid=TILE_CLIENT_UUID, session=session
            )
            await client._request("get", "bad_endpoint")

pytile

A simple Python API for Tile® Bluetooth trackers

MIT
Latest version published 1 year ago

Package Health Score

56 / 100
Full package analysis

Similar packages