def test_mc_called_twice(self): from vilya.libs.store import get_mc mc = get_mc() key = "RANDOM________2f3fddd4455" assert mc.get(key) is None mc.set(key, 'a value') assert mc.get(key) == 'a value' mc2 = get_mc() assert mc2.get(key) == 'a value'
def test_mc(self): from vilya.libs.store import get_mc mc = get_mc() key = "RANDOM________2f3fddd4455" assert mc.get(key) is None, "Cache should be empty after next run" mc.set(key, 'a value') assert mc.get(key) == 'a value'
def test_mc_with_strange_key_using_quote(self): from vilya.libs.store import get_mc import urllib mc = get_mc() key = urllib.quote_plus('sss sés你好的de') assert mc.get(key) is None, "Cache should be empty after next run" mc.set(key, 'a value') assert mc.get(key) == 'a value'