ó
 KMc           @   sŃ   d  Z  e Z d g Z d d l Z d d l Z d d l Z d d l m Z m	 Z	 m
 Z
 m Z d d l Z d d l Z d d l m Z m Z e j e j Be j BZ d   Z d   Z d   Z d	   Z d
   Z d S(   s   Test harness for doctests.t   additional_testsi˙˙˙˙N(   t   resource_filenamet   resource_existst   resource_listdirt   cleanup_resources(   t   installt	   uninstallc         C   s1   d d l  m } t   t j d d | j  d  S(   Ni˙˙˙˙(   t	   WSGILayers   cookbooks.deviP   (   t0   lazr.restful.example.base.tests.test_integrationR   R   t   wsgi_interceptt   add_wsgi_interceptt   make_application(   t   testR   (    (    sF   /usr/lib/python2.7/dist-packages/lazr/restfulclient/tests/test_docs.pyt   setUp,   s    c         C   sI   d d l  m } d d l m } t   | |  } i  | _ d | _ d  S(   Ni˙˙˙˙(   t   IFileManager(   t
   getUtilityi    (   t$   lazr.restful.example.base.interfacesR   t   zope.componentR   R   t   filest   counter(   R   R   R   t   file_manager(    (    sF   /usr/lib/python2.7/dist-packages/lazr/restfulclient/tests/test_docs.pyt   tearDown3   s    	c         C   s   t  j j t d d   g } t d d  r xR t d d  D]> } | j |   r= | j t  j j t d d |    q= q= Wn  | S(   s(   Find doctests matching a certain suffix.s   lazr.restfulclients
   README.txtt   docss   docs/%s(   t   ost   patht   abspathR   R   R   t   endswitht   append(   t   suffixt   doctest_filest   name(    (    sF   /usr/lib/python2.7/dist-packages/lazr/restfulclient/tests/test_docs.pyt   find_doctests<   s    	c       	   C   sc   d d l  m }  t d t d t d t d t  } t j t	  t
 j t d  |   } |  | _ | S(   s7   Run the doc tests (README.txt and docs/*, if any exist)i˙˙˙˙(   R   t   module_relativet   optionflagsR   R   s   .txt(   R   R   t   dictt   Falset   DOCTEST_FLAGSR   R   t   atexitt   registerR   t   doctestt   DocFileSuiteR   t   layer(   R   t   kwargst   suite(    (    sF   /usr/lib/python2.7/dist-packages/lazr/restfulclient/tests/test_docs.pyR    L   s    	c          C   s>   t  d t d t  }  t j t  t j t d  |    } | S(   s+   Run the tests that don't need lazr.restful.R    R!   s   .standalone.txt(	   R"   R#   R$   R%   R&   R   R'   R(   R   (   R*   R+   (    (    sF   /usr/lib/python2.7/dist-packages/lazr/restfulclient/tests/test_docs.pyt   standalone_testsW   s    (   t   __doc__t   typet   __metaclass__t   __all__R%   R'   R   t   pkg_resourcesR   R   R   R   t   unittestR	   t!   wsgi_intercept.httplib2_interceptR   R   t   ELLIPSISt   NORMALIZE_WHITESPACEt   REPORT_NDIFFR$   R   R   R   R    R,   (    (    (    sF   /usr/lib/python2.7/dist-packages/lazr/restfulclient/tests/test_docs.pyt   <module>   s    	"
					