Exemplo n.º 1
0
    def test_invalidate_one_key(self):
        sychache = SyCache("def")
        sychache.set("key1", "data1")
        sychache.set("key2", "data2")

        sychache.invalidate("key1")
        self.assertEquals("def", sychache.get("key1"))
        self.assertEquals("data2", sychache.get("key2"))
Exemplo n.º 2
0
    def test_get_different_values_for_different_keys(self):
        sychache = SyCache()
        sychache.set("key1", "data1")
        sychache.set("key2", "data2")

        self.assertEquals("data1", sychache.get("key1"))
        self.assertEquals("data2", sychache.get("key2"))
        self.assertIsNone(sychache.get("key3"))