class documentation

Setup and tests for basic invocation of MemCacheProtocol commands.

Method test_add MemCacheProtocol.add returns a Deferred which is called back with True when the operation succeeds.
Method test_decrement Test decrementing a variable: MemCacheProtocol.decrement returns a Deferred which is called back with the decremented value of the given key.
Method test_decrementVal MemCacheProtocol.decrement takes an optional argument value which replaces the default value of 1 when specified.
Method test_delete MemCacheProtocol.delete returns a Deferred which is called back with True when the server notifies a success.
Method test_emptyGet Test getting a non-available key: it succeeds but return None as value and 0 as flag.
Method test_errorAdd Test an erroneous add: if a MemCacheProtocol.add is called but the key already exists on the server, it returns a NOT STORED answer, which calls back the resulting Deferred with False.
Method test_errorDelete Test an error during a delete: if key doesn't exist on the server, it returns a NOT FOUND answer which calls back the resulting Deferred with False.
Method test_errorReplace Test an erroneous replace: if a MemCacheProtocol.replace is called but the key doesn't exist on the server, it returns a NOT STORED answer, which calls back the resulting Deferred with False.
Method test_flushAll MemCacheProtocol.flushAll returns a Deferred which is called back with True if the server acknowledges success.
Method test_get MemCacheProtocol.get returns a Deferred which is called back with the value and the flag associated with the given key if the server returns a successful result.
Method test_getMultiple MemCacheProtocol.getMultiple returns a Deferred which is called back with a dictionary of flag, value for each given key.
Method test_getMultipleWithEmpty When MemCacheProtocol.getMultiple is called with non-available keys, the corresponding tuples are (0, None).
Method test_increment Test incrementing a variable: MemCacheProtocol.increment returns a Deferred which is called back with the incremented value of the given key.
Method test_incrementVal MemCacheProtocol.increment takes an optional argument value which replaces the default value of 1 when specified.
Method test_replace MemCacheProtocol.replace returns a Deferred which is called back with True when the operation succeeds.
Method test_set MemCacheProtocol.set returns a Deferred which is called back with True when the operation succeeds.
Method test_stats Test retrieving server statistics via the MemCacheProtocol.stats command: it parses the data sent by the server and calls back the resulting Deferred with a dictionary of the received statistics.
Method test_statsWithArgument MemCacheProtocol.stats takes an optional bytes argument which, if specified, is sent along with the STAT command. The STAT responses from the server are parsed as key/value pairs and returned as a dict...
Method test_version Test version retrieval via the MemCacheProtocol.version command: it returns a Deferred which is called back with the version sent by the server.
Method _test Helper test method to test the resulting Deferred of a MemCacheProtocol command.
def test_add(self): (source)

MemCacheProtocol.add returns a Deferred which is called back with True when the operation succeeds.

def test_decrement(self): (source)

Test decrementing a variable: MemCacheProtocol.decrement returns a Deferred which is called back with the decremented value of the given key.

def test_decrementVal(self): (source)

MemCacheProtocol.decrement takes an optional argument value which replaces the default value of 1 when specified.

def test_delete(self): (source)

MemCacheProtocol.delete returns a Deferred which is called back with True when the server notifies a success.

def test_emptyGet(self): (source)

Test getting a non-available key: it succeeds but return None as value and 0 as flag.

def test_errorAdd(self): (source)

Test an erroneous add: if a MemCacheProtocol.add is called but the key already exists on the server, it returns a NOT STORED answer, which calls back the resulting Deferred with False.

def test_errorDelete(self): (source)

Test an error during a delete: if key doesn't exist on the server, it returns a NOT FOUND answer which calls back the resulting Deferred with False.

def test_errorReplace(self): (source)

Test an erroneous replace: if a MemCacheProtocol.replace is called but the key doesn't exist on the server, it returns a NOT STORED answer, which calls back the resulting Deferred with False.

def test_flushAll(self): (source)

MemCacheProtocol.flushAll returns a Deferred which is called back with True if the server acknowledges success.

def test_get(self): (source)

MemCacheProtocol.get returns a Deferred which is called back with the value and the flag associated with the given key if the server returns a successful result.

def test_getMultiple(self): (source)

MemCacheProtocol.getMultiple returns a Deferred which is called back with a dictionary of flag, value for each given key.

def test_getMultipleWithEmpty(self): (source)

When MemCacheProtocol.getMultiple is called with non-available keys, the corresponding tuples are (0, None).

def test_increment(self): (source)

Test incrementing a variable: MemCacheProtocol.increment returns a Deferred which is called back with the incremented value of the given key.

def test_incrementVal(self): (source)

MemCacheProtocol.increment takes an optional argument value which replaces the default value of 1 when specified.

def test_replace(self): (source)

MemCacheProtocol.replace returns a Deferred which is called back with True when the operation succeeds.

def test_set(self): (source)

MemCacheProtocol.set returns a Deferred which is called back with True when the operation succeeds.

def test_stats(self): (source)

Test retrieving server statistics via the MemCacheProtocol.stats command: it parses the data sent by the server and calls back the resulting Deferred with a dictionary of the received statistics.

def test_statsWithArgument(self): (source)

MemCacheProtocol.stats takes an optional bytes argument which, if specified, is sent along with the STAT command. The STAT responses from the server are parsed as key/value pairs and returned as a dict (as in the case where the argument is not specified).

def test_version(self): (source)

Test version retrieval via the MemCacheProtocol.version command: it returns a Deferred which is called back with the version sent by the server.

def _test(self, d, send, recv, result): (source)

Helper test method to test the resulting Deferred of a MemCacheProtocol command.