test_get_all.test_async_object()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 8
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 8
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 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