def testGets(self): c = Client(MEMCACHED_ADDRESS) c.connect() c.set("key", "value") self.assertEquals("value", c.gets("key")[0]) self.assertEquals(None, c.gets("key23123")) r = c.gets("key") self.assertEquals(3, len(r)) pass
def testCas(self): c = Client(MEMCACHED_ADDRESS) c.connect() c.set("key1", "a") value, flags, cas = c.gets("key1") self.assertEquals("STORED", c.cas("key1", "b", cas)) c.set("key1", "a") self.assertEquals("EXISTS", c.cas("key1", "b", cas))