
Y[c           @   s   d  Z  d d l Z d d l Z d d l m Z d d l m Z d d l m Z d e j	 f d     YZ
 d e j	 f d	     YZ e d
 k r e j   n  d S(   s   Tests for certbot.errors.iN(   t   messages(   t   achallenges(   t	   acme_utilt   FailedChallengesTestc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s*   Tests for certbot.errors.FailedChallenges.c         C   sk   d d l  m } | t t j d d d t j d t j d d  d t j
 d	 d
 d d    g   |  _ d  S(   Ni(   t   FailedChallengest   domains   example.comt   challbt   challt   urit   errort   typt   tlst   detail(   t   certbot.errorsR   t   setR   t   DNSR    t   ChallengeBodyR   t   DNS01t   Nonet   ErrorR	   (   t   selfR   (    (    s=   /usr/lib/python2.7/dist-packages/certbot/tests/errors_test.pyt   setUp   s
    c         C   s#   |  j  t |  j  j d   d  S(   Ns9   Failed authorization procedure. example.com (dns-01): tls(   t
   assertTruet   strR	   t
   startswith(   R   (    (    s=   /usr/lib/python2.7/dist-packages/certbot/tests/errors_test.pyt   test_str   s    c         C   s   d d l  m } d } | t t j d d d t j d t j d d  d	 t j
 d
 d d |    g   } |  j t |  j d   d  S(   Ni(   R   u
   عدالةR   s   example.comR   R   R   R	   R
   R   R   s9   Failed authorization procedure. example.com (dns-01): tls(   R   R   R   R   R   R    R   R   R   R   R   R   R   R   (   R   R   t   arabic_detailt   arabic_error(    (    s=   /usr/lib/python2.7/dist-packages/certbot/tests/errors_test.pyt   test_unicode   s    '(   t   __name__t
   __module__t   __doc__R   R   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/certbot/tests/errors_test.pyR      s   		t   StandaloneBindErrorTestc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s-   Tests for certbot.errors.StandaloneBindError.c         C   s,   d d l  m } | t j j d  |  _ d  S(   Ni(   t   StandaloneBindErrori  (   R   R!   t   mockt   sentinelR	   (   R   R!   (    (    s=   /usr/lib/python2.7/dist-packages/certbot/tests/errors_test.pyR   )   s    c         C   s6   |  j  t j j |  j j  |  j  d |  j j  d  S(   Ni  (   t   assertEqualR"   R#   R	   t   socket_errort   port(   R   (    (    s=   /usr/lib/python2.7/dist-packages/certbot/tests/errors_test.pyt   test_instance_args-   s    c         C   s#   |  j  t |  j  j d   d  S(   Ns   Problem binding to port 1234: (   R   R   R	   R   (   R   (    (    s=   /usr/lib/python2.7/dist-packages/certbot/tests/errors_test.pyR   1   s    (   R   R   R   R   R'   R   (    (    (    s=   /usr/lib/python2.7/dist-packages/certbot/tests/errors_test.pyR    &   s   		t   __main__(   R   t   unittestR"   t   acmeR    t   certbotR   t   certbot.testsR   t   TestCaseR   R    R   t   main(    (    (    s=   /usr/lib/python2.7/dist-packages/certbot/tests/errors_test.pyt   <module>   s   