summaryrefslogtreecommitdiffstats
path: root/contrib/python/yarl/tests/test_cache.py
blob: 46d5b01f159a4cc043c9a235d4ceb0b51da24d21 (plain) (blame)
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
import yarl

# Don't check the actual behavior but make sure that calls are allowed


def teardown_module():
    yarl.cache_configure()


def test_cache_clear() -> None:
    yarl.cache_clear()


def test_cache_info() -> None:
    info = yarl.cache_info()
    assert info.keys() == {"idna_encode", "idna_decode", "ip_address"}


def test_cache_configure_default() -> None:
    yarl.cache_configure()


def test_cache_configure_None() -> None:
    yarl.cache_configure(
        idna_encode_size=None, idna_decode_size=None, ip_address_size=None
    )


def test_cache_configure_explicit() -> None:
    yarl.cache_configure(
        idna_encode_size=128, idna_decode_size=128, ip_address_size=128
    )