a  zeO@sddlZddlZddlZddlmZddlmZmZddlm Z ddl m Z z ddl Z Wne yndZ Yn0ejeZGddde je jejZdd Zed kreedS) N) run_unittest)check HAS_DOCUTILS)support)DistutilsSetupErrorc@sbeZdZdddZddZeedddZeedd d Z eedd d Z d dZ dS) CheckTestCaseNc Ks|dur i}|dur&t}t||jfi|\}}t|}||D]\}} t||| qR|| |durt||SN) osgetcwdchdir create_distrZinitialize_optionsitemssetattrZensure_finalizedrun) selfmetadatacwdoptionsZold_dirpkg_infodistcmdnamevaluerN/opt/bitninja-python-dojo/embedded/lib/python3.9/distutils/tests/test_check.py_runs  zCheckTestCase._runcCs|}||jddddddd}||}||jd|jt|jifiddi|j|dd}||jddddddd d d }||}||jddS) Nxxx)urlauthor author_emailrversionrstrict)r"uÉricuSomething about esszet ßuMore things about esszet ß)rrr rr! descriptionlong_description)r assertEqual _warnings assertRaisesr)rrrrrrtest_check_metadata)s&  z!CheckTestCase.test_check_metadatazwon't test without docutilscCsT|\}}t|}d}||}|t|dd}||}|t|ddS)Ntitle === testr#ztitle ===== testr)r r_check_rst_datar&len)rrrr broken_restmsgsrestrrrtest_check_documentJs   z!CheckTestCase.test_check_documentcCsd}|j|d\}}t|}|||jdddddd|d}|jt|j|fidddd|d<|j|ddd}||jd d |d<|j|tddd }||jd dS) Nr*r%r#r)rrr rr!r%r"restructuredtextutitle ===== test ßr%rz)title ===== .. include:: includetest.rst)rr"r3) r rcheck_restructuredtextr&r'r(rrHERE)rr-rrrrrrrtest_check_restructuredtextYs&z)CheckTestCase.test_check_restructuredtextcCsg}|td|td|D]p}|j|d\}}t|}|||}tdurp|t |dq(|t |d|t |dddq(dS)Nz} Here's some code: .. code:: python def foo(): pass z Here's some code: .. code-block:: python def foo(): pass r1rr#z0Cannot analyze code. Pygments package not found.) appendtextwrapdedentr rr4r+pygmentsr&r,str)rZexample_rst_docsZrest_with_coderrrr.rrr1test_check_restructuredtext_with_syntax_highlightts  z?CheckTestCase.test_check_restructuredtext_with_syntax_highlightcCs,ddd}|jt|jifiddddS)Nr)rrr#r2)r(rr)rrrrrtest_check_alls  zCheckTestCase.test_check_all)NN) __name__ __module__ __qualname__rr)unittestZ skipUnlessrr0r6r<r=rrrrrs !      #rcCs ttSr)rAZ makeSuiterrrrr test_suitesrB__main__)r r8rAZ test.supportrZdistutils.command.checkrrZdistutils.testsrZdistutils.errorsrr: ImportErrorpathdirname__file__r5ZLoggingSilencerZTempdirManagerZTestCaserrBr>rrrrs&