Exemple #1
0
 def test_cache3(self):
     r = Client()
     r.setex("kiki", 0.05, 42)
     assert r.incr("kiki", 6) == 48
     assert "kiki" in r.keys()
     time.sleep(0.05)
     assert "kiki" not in r.keys()
Exemple #2
0
    def test_2(self):
        r = Client()
        assert r.set("kkk", "v") == True

        assert r.get("kkk") == "v"

        assert "kkk" in r.keys()

        assert r.delete("kkk") == True

        assert "kkk" not in r.keys()
Exemple #3
0
 def test_x(self):
     r1 = Client()
     r2 = Client()
     r3 = Client()
     assert r1.set("yo", 666) == True
     assert r2.get("yo") == 666
     assert "yo" in r3.keys()
Exemple #4
0
 def test_cache4(self):
     r = Client()
     r.set("kiki", [1, 2, 3], 0.05)
     assert "kiki" in r.keys()
     time.sleep(0.05)
     assert "kiki" not in r.keys()