File: test_functionals.py

package info (click to toggle)
aioxmlrpc 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 212 kB
  • sloc: python: 615; makefile: 5
file content (32 lines) | stat: -rw-r--r-- 793 bytes parent folder | download
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
from datetime import datetime
from aioxmlrpc.client import ServerProxy, MultiCall


async def test_method(client: ServerProxy):
    assert await client.pow(4, 2) == 16


async def test_lambda(client: ServerProxy):
    assert await client.add(4, 2) == 6


async def test_coroutine(client: ServerProxy):
    assert await client.multiply(4, 2) == 8


async def test_decorator(client: ServerProxy):
    assert await client.substract(16, 2) == 14


async def test_dotted(client: ServerProxy):
    assert await client.get_data() == "42"
    assert await client.dt.now() == datetime.today()


async def test_multicall(client: ServerProxy):
    multicall = MultiCall(client)
    multicall.pow(4, 2)
    multicall.add(4, 2)
    resp = await multicall()
    assert resp[0] == 16
    assert resp[1] == 6