File: test_client.py

package info (click to toggle)
python-aiorecollect 2023.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 436 kB
  • sloc: python: 281; sh: 41; makefile: 5
file content (27 lines) | stat: -rw-r--r-- 630 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Run an example script to quickly test the client."""
import asyncio
import logging

from aiorecollect import Client
from aiorecollect.errors import RequestError

_LOGGER = logging.getLogger(__name__)

PLACE_ID = "8F592BA0-B889-11E4-9A6A-C64A8E6A6F5F"
SERVICE_ID = 208


async def main() -> None:
    """Create the aiohttp session and run the example."""
    logging.basicConfig(level=logging.INFO)

    client = Client(PLACE_ID, SERVICE_ID)

    try:
        pickup_data = await client.async_get_pickup_events()
        _LOGGER.info(pickup_data)
    except RequestError as err:
        _LOGGER.error(err)


asyncio.run(main())