
    Vh]                     B    d Z ddlmZmZ  G d dej                        Zy)z
Receivers for use in tests.
    )baseipositioningc                   "    e Zd ZdZd Zd Zd Zy)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                 p    | j                          t        j                  D ]  }| j                  |        y )N)clearr   IPositioningReceiver_addCallback)self
methodNames     Q/home/dcms/DCMS/lib/python3.12/site-packages/twisted/positioning/test/receiver.py__init__z MockPositioningReceiver.__init__   s.    

&;; 	*Jj)	*    c                     i | _         y)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                 .      fd}t         |       y)zq
        Adds a callback of the given name, setting C{self.called[name]} to
        C{True} when called.
        c                  $    dj                   <   y )NTr   )akwnamer   s     r   callbackz6MockPositioningReceiver._addCallback.<locals>.callback*   s     $DKK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      s    	*	&r   r   N)r   twisted.positioningr   r   BasePositioningReceiverr   r   r   r   <module>r!      s!   
 3"&d:: "&r   