File: //proc/self/root/lib/python3/dist-packages/twisted/test/__pycache__/test_memcache.cpython-38.pyc
U
W[7b � @ s� d Z ddlmZmZ ddlmZ ddlmZmZ ddlm Z m
Z
ddlmZ ddl
mZ ddlmZ dd lmZmZmZ dd
lmZ G dd� d�ZG d
d� dee�ZG dd� dee�ZdS )z$
Test the memcache client protocol.
� )�absolute_import�division)�ConnectionDone)�MemCacheProtocol�
NoSuchCommand)�ClientError�ServerError)�TestCase)� StringTransportWithDisconnection)�Clock)�Deferred�
gatherResults�TimeoutError)�DeferredListc @ s� e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd$d%� Zd&d'� Zd(d)� Zd*S )+�CommandMixinzO
Setup and tests for basic invocation of L{MemCacheProtocol} commands.
c C s
t � �dS )zp
Helper test method to test the resulting C{Deferred} of a
L{MemCacheProtocol} command.
N)�NotImplementedError��self�d�send�recv�result� r �</usr/lib/python3/dist-packages/twisted/test/test_memcache.py�_test s zCommandMixin._testc C s | � | j�d�ddd�S )z�
L{MemCacheProtocol.get} returns a L{Deferred} which is called back with
the value and the flag associated with the given key if the server
returns a successful result.
� foo� get foo
� VALUE foo 0 3
bar
END
�r � bar�r �proto�get�r r r r �test_get$ s
�zCommandMixin.test_getc C s | � | j�d�ddd�S )zu
Test getting a non-available key: it succeeds but return L{None} as
value and C{0} as flag.
r r � END
�r Nr r# r r r �
test_emptyGet/ s
�zCommandMixin.test_emptyGetc C s"