Esempio n. 1
0
 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
Esempio n. 2
0
 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
Esempio n. 3
0
 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))
Esempio n. 4
0
 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))