
    \d]                     @    d Z ddlmZmZ  G d dej                  ZdS )z
Receivers for use in tests.
    )baseipositioningc                   $    e Zd ZdZd Zd Z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                 v    |                                   t          j        D ]}|                     |           d S )N)clearr   IPositioningReceiver_addCallback)self
methodNames     Alib/python3.11/site-packages/twisted/positioning/test/receiver.py__init__z MockPositioningReceiver.__init__   sB    

&; 	* 	*Jj))))	* 	*    c                     i | _         dS )zt
        Forget all the methods that have been called on this receiver, by
        emptying C{self.called}.
        Ncalled)r   s    r   r   zMockPositioningReceiver.clear   s    
 r   c                 8      fd}t           |           dS )zq
        Adds a callback of the given name, setting C{self.called[name]} to
        C{True} when called.
        c                      dj         <   d S )NTr   )akwnamer   s     r   callbackz6MockPositioningReceiver._addCallback.<locals>.callback*   s     $DKr   N)setattr)r   r   r   s   `` r   r
   z$MockPositioningReceiver._addCallback$   s<    	% 	% 	% 	% 	% 	% 	dH%%%%%r   N)__name__
__module____qualname____doc__r   r   r
    r   r   r   r      sK        	 	* * *  	& 	& 	& 	& 	&r   r   N)r   twisted.positioningr   r   BasePositioningReceiverr   r   r   r   <module>r!      s`    
 3 2 2 2 2 2 2 2"& "& "& "& "&d: "& "& "& "& "&r   