summaryrefslogtreecommitdiff
path: root/test/test_telegram_aio_send_photo.py
blob: 4d05c0325cc56fc35783555512e91a6f30614aba (plain)
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
#!/usr/bin/env python3
import asyncio
import sys
import os.path
sys.path.extend([
    os.path.realpath(
        os.path.join(os.path.dirname(os.path.join(__file__)), '..')
    )
])

import src.home.telegram.aio as telegram

from src.home.config import config


async def main():
    await telegram.send_message(f'test message')
    await telegram.send_photo('/tmp/3.jpg')
    await telegram.send_photo('/tmp/4.jpg')


if __name__ == '__main__':
    config.load_app('test_telegram_aio_send_photo')

    loop = asyncio.get_event_loop()
    asyncio.ensure_future(main())

    try:
        loop.run_forever()
    except KeyboardInterrupt:
        pass