File: test_currencies.py

package info (click to toggle)
python-aioopenexchangerates 0.4.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: python: 298; makefile: 13; javascript: 8
file content (25 lines) | stat: -rw-r--r-- 586 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
"""Test endpoint currencies.json."""

from collections.abc import Callable
import json

from aioresponses import aioresponses

from aioopenexchangerates.client import Client


async def test_get_latest_symbols(
    client: Client,
    mock_response: aioresponses,
    currencies: str,
    generate_url: Callable[..., str],
) -> None:
    """Test get_currencies."""
    mock_response.get(
        generate_url("currencies.json", show_alternative=0, show_inactive=0),
        body=currencies,
    )

    result = await client.get_currencies()

    assert result == json.loads(currencies)