test_cache.py 615 B

12345678910111213141516171819202122232425262728
  1. import yarl
  2. # Don't check the actual behavior but make sure that calls are allowed
  3. def teardown_module():
  4. yarl.cache_configure()
  5. def test_cache_clear() -> None:
  6. yarl.cache_clear()
  7. def test_cache_info() -> None:
  8. info = yarl.cache_info()
  9. assert info.keys() == {"idna_encode", "idna_decode"}
  10. def test_cache_configure_default() -> None:
  11. yarl.cache_configure()
  12. def test_cache_configure_None() -> None:
  13. yarl.cache_configure(idna_encode_size=None, idna_decode_size=None)
  14. def test_cache_configure_explicit() -> None:
  15. yarl.cache_configure(idna_encode_size=128, idna_decode_size=128)