o TZ @sdZeZdgZddlZddlZddlZddlmZm Z m Z m Z ddl Z ddl mZmZejejBejBZddZdd Zd d d Zd dZdS)zTest harness for doctests. load_testsN)resource_filenameresource_existsresource_listdircleanup_resources)install uninstallcCs&ddlm}ttdd|jdS)Nr WSGILayerz cookbooks.devP)0lazr.restful.example.base.tests.test_integrationr rwsgi_interceptadd_wsgi_interceptmake_application)testr rD/usr/lib/python3/dist-packages/lazr/restfulclient/tests/test_docs.pysetUp,s rcCs6ddlm}ddlm}t||}i|_d|_dS)Nr) IFileManager) getUtility)$lazr.restful.example.base.interfacesrzope.componentrrfilescounter)rrr file_managerrrrtearDown3s   rc Cs\g}tddr,tddD]}|dur||rq ||r+|tjtdd|q |S)z(Find doctests matching a certain suffix.zlazr.restfulclientdocsNzdocs/%s)rrendswithappendospathabspathr)suffix ignore_suffix doctest_filesnamerrr find_doctests<s  r&cCsdddlm}tttjtddddtt t d}||_ | || tjtddtd|S) zLoad all the doctests.rr z.rstz.standalone.rst)r#F)module_relative optionflagsrr)r'r() r r atexitregisterrdoctest DocFileSuiter& DOCTEST_FLAGSrrlayeraddTest)loadertestspatternr restful_suiterrrrLs     )N)__doc__type __metaclass____all__r)r+r pkg_resourcesrrrrr !wsgi_intercept.httplib2_interceptrrELLIPSISNORMALIZE_WHITESPACE REPORT_NDIFFr-rrr&rrrrrs(