class CommandMixin: (source)
Known subclasses: twisted.test.test_memcache.CommandFailureTests
, twisted.test.test_memcache.MemCacheTests
Setup and tests for basic invocation of MemCacheProtocol
commands.
Method | test |
MemCacheProtocol.add returns a Deferred which is called back with True when the operation succeeds. |
Method | test |
Test decrementing a variable: MemCacheProtocol.decrement returns a Deferred which is called back with the decremented value of the given key. |
Method | test_decrement |
MemCacheProtocol.decrement takes an optional argument value which replaces the default value of 1 when specified. |
Method | test |
MemCacheProtocol.delete returns a Deferred which is called back with True when the server notifies a success. |
Method | test_empty |
Test getting a non-available key: it succeeds but return None as value and 0 as flag. |
Method | test_error |
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_error |
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_error |
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_flush |
MemCacheProtocol.flushAll returns a Deferred which is called back with True if the server acknowledges success. |
Method | test |
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_get |
MemCacheProtocol.getMultiple returns a Deferred which is called back with a dictionary of flag, value for each given key. |
Method | test_get |
When MemCacheProtocol.getMultiple is called with non-available keys, the corresponding tuples are (0, None). |
Method | test |
Test incrementing a variable: MemCacheProtocol.increment returns a Deferred which is called back with the incremented value of the given key. |
Method | test_increment |
MemCacheProtocol.increment takes an optional argument value which replaces the default value of 1 when specified. |
Method | test |
MemCacheProtocol.replace returns a Deferred which is called back with True when the operation succeeds. |
Method | test |
MemCacheProtocol.set returns a Deferred which is called back with True when the operation succeeds. |
Method | test |
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_stats |
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 |
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. |
Test decrementing a variable: MemCacheProtocol.decrement
returns a Deferred
which is called back with the decremented value of the given key.
MemCacheProtocol.decrement
takes an optional argument value which replaces the default value of 1 when specified.
MemCacheProtocol.delete
returns a Deferred
which is called back with True when the server notifies a success.
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.
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.
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.
MemCacheProtocol.flushAll
returns a Deferred
which is called back with True if the server acknowledges success.
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.
MemCacheProtocol.getMultiple
returns a Deferred
which is called back with a dictionary of flag, value for each given key.
When MemCacheProtocol.getMultiple
is called with non-available keys, the corresponding tuples are (0, None).
Test incrementing a variable: MemCacheProtocol.increment
returns a Deferred
which is called back with the incremented value of the given key.
MemCacheProtocol.increment
takes an optional argument value which replaces the default value of 1 when specified.
MemCacheProtocol.replace
returns a Deferred
which is called back with True when the operation succeeds.
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.
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).
Test version retrieval via the MemCacheProtocol.version
command: it returns a Deferred
which is called back with the version sent by the server.
twisted.test.test_memcache.CommandFailureTests
, twisted.test.test_memcache.MemCacheTests
Helper test method to test the resulting Deferred of a MemCacheProtocol
command.