test_utils.py 431 字节
Newer Older
1 2 3 4 5 6
import pytest

import megengine
from megengine.utils.persistent_cache import PersistentCacheOnServer


7
@pytest.mark.skip(reason="fixme: github ci failed")
8 9 10 11 12 13 14 15 16 17
def test_persistent_cache():
    pc = PersistentCacheOnServer()
    k0 = b"\x00\x00"
    k1 = b"\x00\x01"
    cat = "test"
    pc.put(cat, k0, k1)
    pc.put(cat, k1, k0)
    assert k1 == pc.get(cat, k0)
    assert k0 == pc.get(cat, k1)
    assert pc.get("test1", k0) == None