ó
`¾Tc           @   su   d  Z  d d l 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
 d	 „  Z d S(
   s  
    werkzeug.testsuite.exceptions
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    The tests for the exception classes.

    TODO:

    -   This is undertested.  HTML is never checked

    :copyright: (c) 2014 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
iÿÿÿÿN(   t   WerkzeugTestCase(   t
   exceptions(   t   Response(   t	   text_typet   ExceptionsTestCasec           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s   t  d ƒ } y t j | ƒ Wn% t j k
 rD } | j i  ƒ } n X|  j d ƒ |  j | | k ƒ |  j | j ƒ  d ƒ d  S(   Ns   Hello Worlds   exception not raised(	   R   R   t   abortt   HTTPExceptiont   get_responset   failt   assert_truet   assert_equalt   get_data(   t   selft	   orig_respt   et   resp(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/testsuite/exceptions.pyt   test_proxy_exception   s    c         C   s,  t  j } |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d d d g ƒ |  j t  j | d ƒ |  j t  j	 | d	 ƒ |  j t  j
 | d
 ƒ |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d ƒ |  j t  j | d ƒ t  j i t  j d 6ƒ } |  j t | d ƒ |  j t  j | d ƒ t  j d i t  j d 6ƒ } |  j t  j | d ƒ |  j t  j | d ƒ d  S(   Ni  i‘  i“  i”  i•  t   GETt   HEADi–  i˜  iš  i›  iœ  i  iž  iŸ  i¦  iô  iõ  iö  i÷  i   t   extra(   R   R   t   assert_raisest
   BadRequestt   Unauthorizedt	   Forbiddent   NotFoundt   MethodNotAllowedt   NotAcceptablet   RequestTimeoutt   Gonet   LengthRequiredt   PreconditionFailedt   RequestEntityTooLarget   RequestURITooLarget   UnsupportedMediaTypet   UnprocessableEntityt   InternalServerErrort   NotImplementedt
   BadGatewayt   ServiceUnavailablet   Abortert   LookupError(   R   R   t   myabort(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/testsuite/exceptions.pyt   test_aborter%   s2    	c         C   sw   t  j ƒ  } |  j t | ƒ d ƒ |  j t | ƒ d ƒ t  j d ƒ } |  j t | ƒ d ƒ |  j t | ƒ d ƒ d  S(   Ns   404: Not Founds   <NotFound '404: Not Found'>s	   Not There(   R   R   R
   R   t   repr(   R   t   exc(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/testsuite/exceptions.pyt   test_exception_reprB   s    c         C   s^   t  j d d d g ƒ } t | j i  ƒ ƒ } |  j | d d ƒ |  j d | j ƒ  k ƒ d  S(   NR   R   t   POSTt   Allows   GET, HEAD, POSTs   The method is not allowed(   R   R   t   dictt   get_headersR
   R	   t   get_description(   R   R,   t   h(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/testsuite/exceptions.pyt   test_special_exceptionsK   s    (   t   __name__t
   __module__R   R*   R-   R4   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/testsuite/exceptions.pyR      s   				c          C   s&   t  j ƒ  }  |  j t  j t ƒ ƒ |  S(   N(   t   unittestt	   TestSuitet   addTestt	   makeSuiteR   (   t   suite(    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/testsuite/exceptions.pyR;   R   s    (   t   __doc__R7   t   werkzeug.testsuiteR    t   werkzeugR   t   werkzeug.wrappersR   t   werkzeug._compatR   R   R;   (    (    (    sc   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/werkzeug/testsuite/exceptions.pyt   <module>   s   :