Ñò
ÜÂKc           @   s`   d  Z  d d k l Z d d k l Z l Z l Z l Z d „  Z d „  Z	 d „  Z
 d „  Z d S(	   s¤   
    werkzeug.exceptiosn test
    ~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: (c) 2010 by the Werkzeug Team, see AUTHORS for more details.
    :license: BSD license.
iÿÿÿÿ(   t   assert_raises(   t
   exceptionst   Responset   abortt   Aborterc          C   s„   t  d ƒ }  y t |  ƒ Wn' t i j
 o } | i h  ƒ } n Xt p
 t d ‚ | |  j p t ‚ | i d j p t ‚ d S(   s   Proxy exceptionss   Hello Worlds   exception not raisedN(   R   R   R   t   HTTPExceptiont   get_responset   Falset   AssertionErrort   data(   t	   orig_respt   et   resp(    (    sC   /Users/mitsuhiko/Development/werkzeug-main/tests/test_exceptions.pyt   test_proxy_exception   s    c          C   sÈ  t  t i t d ƒ t  t i t d ƒ t  t i t d ƒ t  t i t d ƒ t  t i t d d d g ƒ t  t i t d ƒ t  t i	 t d	 ƒ t  t i
 t d
 ƒ t  t i t d ƒ t  t i t d ƒ t  t i t d ƒ t  t i t d ƒ t  t i t d ƒ t  t i t d ƒ t  t i t d ƒ t  t i t d ƒ t  t i t d ƒ t h t i d 6ƒ }  t  t |  d ƒ t  t i |  d ƒ t d h t i d 6ƒ }  t  t i |  d ƒ t  t i |  d ƒ d S(   s   Exception aborteri  i‘  i“  i”  i•  t   GETt   HEADi–  i˜  iš  i›  iœ  i  iž  iŸ  iô  iõ  iö  i÷  i   t   extraN(   R    R   t
   BadRequestR   t   Unauthorizedt	   Forbiddent   NotFoundt   MethodNotAllowedt   NotAcceptablet   RequestTimeoutt   Gonet   LengthRequiredt   PreconditionFailedt   RequestEntityTooLarget   RequestURITooLarget   UnsupportedMediaTypet   InternalServerErrort   NotImplementedt
   BadGatewayt   ServiceUnavailableR   t   LookupError(   t   myabort(    (    sC   /Users/mitsuhiko/Development/werkzeug-main/tests/test_exceptions.pyt   test_aborter   s.    c          C   s‡   t  i ƒ  }  t |  ƒ d j p t ‚ t |  ƒ d j p t ‚ t  i d ƒ }  t |  ƒ d j p t ‚ t |  ƒ d j p t ‚ d S(   s   Repr and unicode of exceptionss   404: Not Founds   <NotFound '404: Not Found'>s	   Not Theres   404: Not Theres   <NotFound '404: Not There'>N(   R   R   t   unicodeR   t   repr(   t   exc(    (    sC   /Users/mitsuhiko/Development/werkzeug-main/tests/test_exceptions.pyt   test_exception_repr8   s    c          C   sm   t  i d d d g ƒ }  t |  i h  ƒ ƒ } | d d j p t ‚ d |  i h d d 6ƒ j p t ‚ d	 S(
   s   Special HTTP exceptionsR   R   t   POSTt   Allows   GET, HEAD, POSTs    The method DELETE is not allowedt   DELETEt   REQUEST_METHODN(   R   R   t   dictt   get_headersR   t   get_description(   R'   t   h(    (    sC   /Users/mitsuhiko/Development/werkzeug-main/tests/test_exceptions.pyt   test_special_exceptionsC   s
    N(   t   __doc__t
   nose.toolsR    t   werkzeugR   R   R   R   R   R$   R(   R1   (    (    (    sC   /Users/mitsuhiko/Development/werkzeug-main/tests/test_exceptions.pyt   <module>   s   "			