| Total Complexity | 2 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from yfrake import client |
||
| 2 | import asyncio |
||
| 3 | import sys |
||
| 4 | |||
| 5 | |||
| 6 | if sys.platform == 'win32': |
||
| 7 | asyncio.set_event_loop_policy( |
||
| 8 | asyncio.WindowsSelectorEventLoopPolicy() |
||
| 9 | ) |
||
| 10 | |||
| 11 | |||
| 12 | async def test_async_object(): |
||
| 13 | @client.session |
||
| 14 | async def inner(): |
||
| 15 | results = client.get_all(symbol='msft') |
||
| 16 | async for resp in results.gather(): |
||
| 17 | assert bool(resp.error) is False |
||
| 18 | assert bool(resp.data) is True |
||
| 19 | await inner() |
||
| 20 |