ó
¥"€Mc           @   s¬   d  Z  e Z d d l m Z d d l m Z d d l m Z d d l	 m
 Z
 d 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(   s.   
Tests for implementations of L{IReactorUDP}.
iÿÿÿÿ(   t
   SOCK_DGRAM(   t   verifyObject(   t   ReactorBuilder(   t   IListeningPort(   t   IPv4Address(   t   DatagramProtocol(   t   findFreePortt   UDPServerTestsBuilderc           B   s    e  Z d  Z d „  Z d „  Z RS(   sF   
    Builder defining tests relating to L{IReactorUDP.listenUDP}.
    c         C   s;   |  j  ƒ  } | j d t ƒ  ƒ } |  j t t | ƒ ƒ d S(   sY   
        L{IReactorUDP.listenUDP} returns an object providing L{IListeningPort}.
        i    N(   t   buildReactort	   listenUDPR   t
   assertTrueR   R   (   t   selft   reactort   port(    (    sB   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_udp.pyt   test_interface   s    c         C   sb   t  d t ƒ \ } } |  j ƒ  } | j | t ƒ  d | ƒ} |  j | j ƒ  t d | | ƒ ƒ d S(   s³   
        L{IListeningPort.getHost} returns an L{IPv4Address} giving a
        dotted-quad of the IPv4 address the port is listening on as well as
        the port number.
        t   typet	   interfacet   UDPN(   R   R    R   R	   R   t   assertEqualst   getHostR   (   R   t   hostt
   portNumberR   R   (    (    sB   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_udp.pyt   test_getHost#   s    (   t   __name__t
   __module__t   __doc__R   R   (    (    (    sB   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_udp.pyR      s   		N(   R   R   t   __metaclass__t   socketR    t   zope.interface.verifyR   t#   twisted.internet.test.reactormixinsR   t   twisted.internet.interfacesR   t   twisted.internet.addressR   t   twisted.internet.protocolR   t   twisted.internet.test.test_tcpR   R   t   globalst   updatet   makeTestCaseClasses(    (    (    sB   /usr/lib/python2.7/dist-packages/twisted/internet/test/test_udp.pyt   <module>   s   