You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_utils.py 330 B

123456789101112131415
  1. import pytest
  2. from megengine.utils.persistent_cache import _manager
  3. def test_persistent_cache():
  4. pc = _manager
  5. k0 = b"\x00\x00"
  6. k1 = b"\x00\x01"
  7. cat = "test"
  8. pc.put(cat, k0, k1)
  9. pc.put(cat, k1, k0)
  10. assert k1 == pc.get(cat, k0)
  11. assert k0 == pc.get(cat, k1)
  12. assert pc.get("test1", k0) == None