-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
38 lines (29 loc) · 991 Bytes
/
test.py
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
28
29
30
31
32
33
34
35
36
37
38
from appy_graphql.albert_heijn_api import AlbertHeijn
import asyncio
import aiohttp
async def auth():
async with aiohttp.ClientSession() as session:
ah = AlbertHeijn(session)
authResult = await ah.authorize('...')
print(authResult)
await session.close()
async def refresh():
async with aiohttp.ClientSession() as session:
ah = AlbertHeijn(session, '...')
refreshResult = await ah.refresh('')
print(refreshResult)
await session.close()
async def basket():
async with aiohttp.ClientSession() as session:
ah = AlbertHeijn(session, '...')
basketResult = await ah.getBasket()
print(basketResult)
await session.close()
async def productSearch():
async with aiohttp.ClientSession() as session:
ah = AlbertHeijn(session, '...')
await ah.productSearch('')
await session.close()
# asyncio.run(auth())
# asyncio.run(basket())
# asyncio.run(productSearch())