Known subclasses: twisted.test.test_memcache.CommandFailureTests, twisted.test.test_memcache.MemCacheTests

Setup and tests for basic invocation of MemCacheProtocol commands.

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_emptyGet Test getting a non-available key: it succeeds but return None as value and 0 as flag.
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_set MemCacheProtocol.set returns a Deferred which is called back with True when the operation succeeds.
Method test_add MemCacheProtocol.add returns a Deferred which is called back with True when the operation succeeds.
Method test_replace MemCacheProtocol.replace returns a Deferred which is called back with True when the operation succeeds.
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_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_delete MemCacheProtocol.delete returns a Deferred which is called back with True when the server notifies a success.
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_increment Test incrementing a variable: MemCacheProtocol.increment returns a Deferred which is called back with the incremented value of the given key.
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_incrementVal MemCacheProtocol.increment takes an optional argument value which replaces the default value of 1 when specified.
Method test_decrementVal MemCacheProtocol.decrement takes an optional argument value which replaces the default value of 1 when specified.
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 No summary
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_flushAll MemCacheProtocol.flushAll returns a Deferred which is called back with True if the server acknowledges success.
Method _test Helper test method to test the resulting Deferred of a MemCacheProtocol command.
def _test(self, d, send, recv, result):

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

def test_get(self):

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_emptyGet(self):

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

def test_getMultiple(self):

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

def test_getMultipleWithEmpty(self):

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

def test_set(self):

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

def test_add(self):

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

def test_replace(self):

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

def test_errorAdd(self):

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_errorReplace(self):

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_delete(self):

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

def test_errorDelete(self):

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_increment(self):

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

def test_decrement(self):

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

def test_incrementVal(self):

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

def test_decrementVal(self):

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

def test_stats(self):

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):

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):

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_flushAll(self):

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

API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.