diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-06-17 00:33:19 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-06-17 00:43:26 +0300 |
commit | 58a4a28f588fe2645ee06a17718767775584becb (patch) | |
tree | cb5ca52e2fb642ee0b39b29aa7892765cb9dfa82 /test/test_telegram_aio_send_photo.py | |
parent | fa97ccaa64e1819af3296e95dcbe10fa1c6c788d (diff) |
refactor telegram message reporting
Diffstat (limited to 'test/test_telegram_aio_send_photo.py')
-rw-r--r-- | test/test_telegram_aio_send_photo.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test_telegram_aio_send_photo.py b/test/test_telegram_aio_send_photo.py new file mode 100644 index 0000000..705e534 --- /dev/null +++ b/test/test_telegram_aio_send_photo.py @@ -0,0 +1,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('test_telegram_aio_send_photo') + + loop = asyncio.get_event_loop() + asyncio.ensure_future(main()) + + try: + loop.run_forever() + except KeyboardInterrupt: + pass |