ó
[³XMc           @   s   d  Z  y d d l Z Wn e k
 r/ d Z n Xd d l m Z d d l m Z d d l m	 Z	 d e	 f d „  ƒ  YZ
 e ƒ  j e
 j ƒ  ƒ d S(   s6   
Tests for implementations of L{IReactorWin32Events}.
iÿÿÿÿN(   t   verifyObject(   t   IReactorWin32Events(   t   ReactorBuildert   Win32EventsTestsBuilderc           B   s)   e  Z d  Z e g Z d „  Z d „  Z RS(   sD   
    Builder defining tests relating to L{IReactorWin32Events}.
    c         C   s   |  j  ƒ  } t t | ƒ d S(   sn   
        An instance of the reactor has all of the methods defined on
        L{IReactorWin32Events}.
        N(   t   buildReactorR    R   (   t   selft   reactor(    (    sJ   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyt   test_interface   s    c            s   |  j  ƒ  ‰  t j d t t d ƒ } d t f ‡  f d †  ƒ  Y} | ƒ  } ˆ  j | | d ƒ ˆ  j t j | ƒ |  j	 ˆ  ƒ |  j
 | j ƒ d S(   s„   
        When an event which has been added to the reactor is set, the action
        associated with the event is invoked.
        t   Listenerc              s&   e  Z e Z d  „  Z ‡  f d †  Z RS(   c         S   s   d S(   NR   (    (   R   (    (    sJ   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyt	   logPrefix,   s    c            s   t  |  _ ˆ  j ƒ  d  S(   N(   t   Truet   successt   stop(   R   (   R   (    sJ   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyt   occurred/   s    	(   t   __name__t
   __module__t   FalseR   R	   R   (    (   R   (    sJ   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyR   )   s   	R   N(   R   t
   win32eventt   CreateEventt   NoneR   t   objectt   addEventt   callWhenRunningt   SetEventt
   runReactort
   assertTrueR   (   R   t   eventR   t   listener(    (   R   sJ   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyt   test_addEvent"   s    
	(   R   R   t   __doc__R   t   requiredInterfacesR   R   (    (    (    sJ   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyR      s   			(   R   R   t   ImportErrorR   t   zope.interface.verifyR    t   twisted.internet.interfacesR   t#   twisted.internet.test.reactormixinsR   R   t   globalst   updatet   makeTestCaseClasses(    (    (    sJ   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_win32events.pyt   <module>   s   
'