o
    ¯b]  ã                   @   s*   d Z ddlmZmZ G dd„ dejƒZdS )z
Receivers for use in tests.
é    )ÚbaseÚipositioningc                   @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚMockPositioningReceivera  
    A mock positioning receiver.

    Mocks all the L{IPositioningReceiver} methods with stubs that don't do
    anything but register that they were called.

    @ivar called: A mapping of names of callbacks that have been called to
        C{True}.
    @type called: C{dict}
    c                 C   s"   |   ¡  tjD ]}|  |¡ qd S )N)Úclearr   ÚIPositioningReceiverÚ_addCallback)ÚselfÚ
methodName© r
   úC/usr/lib/python3/dist-packages/twisted/positioning/test/receiver.pyÚ__init__   s   
ÿz MockPositioningReceiver.__init__c                 C   s
   i | _ dS )zt
        Forget all the methods that have been called on this receiver, by
        emptying C{self.called}.
        N©Úcalled)r   r
   r
   r   r      s   
zMockPositioningReceiver.clearc                    s   ‡ ‡fdd„}t ˆˆ |ƒ dS )zq
        Adds a callback of the given name, setting C{self.called[name]} to
        C{True} when called.
        c                     s   dˆj ˆ < d S )NTr   )ÚaÚkw©Únamer   r
   r   Úcallback*   s   z6MockPositioningReceiver._addCallback.<locals>.callbackN)Úsetattr)r   r   r   r
   r   r   r   $   s   z$MockPositioningReceiver._addCallbackN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r
   r
   r
   r   r      s
    r   N)r   Útwisted.positioningr   r   ÚBasePositioningReceiverr   r
   r
   r
   r   Ú<module>   s   