403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_pydoc.cpython-36.pyc
3

�w2_��
@s�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlm Z ddlm!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)ddlm*Z*yddl+Z+Wne,k
�r:dZ+YnXGdd�d�Z-ej.j/�rZd9Z0nd:Z0d
j1�Z2e3dd�e0D��Z4dj1�Z5e3dd�e0D��Z6dj7dej8�Z9dZ:dj1�Z;dj1�Z<dj1�Z=dj1�Z>dj1�Z?dd�Z@dd�ZAdd�ZBd d!�ZCd"d#�ZDGd$d%�d%ejE�ZFGd&d'�d'ejE�ZGGd(d)�d)eF�ZHGd*d+�d+ejE�ZIejJe+d,�Gd-d.�d.ejE��ZKGd/d0�d0eF�ZLGd1d2�d2ejE�ZMGd3d4�d4ejE�ZNe$d5d6��ZOePd7k�r�eO�dS);�N)�StringIO)�
namedtuple)�assert_python_ok)	�TESTFN�rmtree�
reap_children�reap_threads�captured_output�captured_stdout�captured_stderr�unlink�requires_docstrings)�	pydoc_modc@seZdZdZdS)�nonasciiuЦе не латиницяN)�__name__�
__module__�__qualname__�__doc__�rr�4/opt/alt/python36/lib64/python3.6/test/test_pydoc.pyr'sr�.dictionary for instance variables (if defined)�2list of weak references to the object (if defined)��aq
NAME
    test.pydoc_mod - This is a test module for test_pydoc
%s
CLASSES
    builtins.object
        A
        B
        C
    
    class A(builtins.object)
     |  Hello and goodbye
     |  
     |  Methods defined here:
     |  
     |  __init__()
     |      Wow, I have no function!
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__%s
     |  
     |  __weakref__%s
    
    class B(builtins.object)
     |  Data descriptors defined here:
     |  
     |  __dict__%s
     |  
     |  __weakref__%s
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  NO_MEANING = 'eggs'
     |  
     |  __annotations__ = {'NO_MEANING': <class 'str'>}
    
    class C(builtins.object)
     |  Methods defined here:
     |  
     |  get_answer(self)
     |      Return say_no()
     |  
     |  is_it_true(self)
     |      Return self.get_answer()
     |  
     |  say_no(self)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables (if defined)
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)

FUNCTIONS
    doc_func()
        This function solves all of the world's problems:
        hunger
        lack of Python
        war
    
    nodoc_func()

DATA
    __xyz__ = 'X, Y and Z'

VERSION
    1.2.3.4

AUTHOR
    Benjamin Peterson

CREDITS
    Nobody

FILE
    %s
ccs|]}|rd|ndVqdS)z
     |      rNr)�.0�srrr�	<genexpr>�sra*
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="test.html"><font color="#ffffff">test</font></a>.pydoc_mod</strong></big></big> (version 1.2.3.4)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:%s">%s</a>%s</font></td></tr></table>
    <p><tt>This&nbsp;is&nbsp;a&nbsp;test&nbsp;module&nbsp;for&nbsp;test_pydoc</tt></p>
<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%"><dl>
<dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#A">A</a>
</font></dt><dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#B">B</a>
</font></dt><dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#C">C</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="A">class <strong>A</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Hello&nbsp;and&nbsp;goodbye<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%%">Methods defined here:<br>
<dl><dt><a name="A-__init__"><strong>__init__</strong></a>()</dt><dd><tt>Wow,&nbsp;I&nbsp;have&nbsp;no&nbsp;function!</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>%s</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>%s</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="B">class <strong>B</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%">Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>%s</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>%s</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>NO_MEANING</strong> = 'eggs'</dl>

<dl><dt><strong>__annotations__</strong> = {'NO_MEANING': &lt;class 'str'&gt;}</dl>

</td></tr></table> <p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="C">class <strong>C</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%">Methods defined here:<br>
<dl><dt><a name="C-get_answer"><strong>get_answer</strong></a>(self)</dt><dd><tt>Return&nbsp;<a href="#C-say_no">say_no</a>()</tt></dd></dl>

<dl><dt><a name="C-is_it_true"><strong>is_it_true</strong></a>(self)</dt><dd><tt>Return&nbsp;self.<a href="#C-get_answer">get_answer</a>()</tt></dd></dl>

<dl><dt><a name="C-say_no"><strong>say_no</strong></a>(self)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%"><dl><dt><a name="-doc_func"><strong>doc_func</strong></a>()</dt><dd><tt>This&nbsp;function&nbsp;solves&nbsp;all&nbsp;of&nbsp;the&nbsp;world's&nbsp;problems:<br>
hunger<br>
lack&nbsp;of&nbsp;Python<br>
war</tt></dd></dl>
 <dl><dt><a name="-nodoc_func"><strong>nodoc_func</strong></a>()</dt></dl>
</td></tr></table><p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%"><strong>__xyz__</strong> = 'X, Y and Z'</td></tr></table><p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%">Benjamin&nbsp;Peterson</td></tr></table><p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Credits</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%">Nobody</td></tr></table>
ccs|]}|jdd�VqdS)� z&nbsp;N)�replace)rrrrrrsz~No Python documentation found for %r.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.�
z7problem in %s - ModuleNotFoundError: No module named %ra/
Help on class DA in module %s:

class DA(builtins.object)
 |  Data descriptors defined here:
 |  
 |  __dict__%s
 |  
 |  __weakref__%s
 |  
 |  ham
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from Meta:
 |  
 |  ham = 'spam'
z�
Help on class Class in module %s:

class Class(builtins.object)
 |  Data and other attributes inherited from Meta:
 |  
 |  LIFE = 42
z�
Help on class Class1 in module %s:

class Class1(builtins.object)
 |  Data and other attributes inherited from Meta1:
 |  
 |  one = 1
a
Help on class Class2 in module %s:

class Class2(Class1)
 |  Method resolution order:
 |      Class2
 |      Class1
 |      builtins.object
 |  
 |  Data and other attributes inherited from Meta1:
 |  
 |  one = 1
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from Meta3:
 |  
 |  three = 3
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from Meta2:
 |  
 |  two = 2
z�
Help on class C in module %s:

class C(builtins.object)
 |  Data and other attributes defined here:
 |  
 |  here = 'present!'
cOs,||f}tdtjf|�|�\}}}|j�S)zW
    Runs pydoc on the specified module. Returns the stripped
    output of pydoc.
    z-B)r�pydoc�__file__�strip)Zmodule_name�args�envZrc�out�errrrr�	run_pydocVs
r'cCs<tj�}|j|�}|jt�pd}|r0d|d}|j�|fS)z&Returns pydoc generated output as htmlrz
<br><a href="z">Module Docs</a>)r �HTMLDoc�	docmodule�	getdoclocrr")�module�doc�output�locrrr�get_pydoc_html`s
r/cCs6tjj}||tjjt���}tj�}|j||d�}|S)z,Returns a documentation web link of a module)�basedir)�os�path�dirname�realpathr!r �TextDocr*)r+r3r0r,r.rrr�get_pydoc_linkis
r6cCsRtj�}|jt�pd}|r&d|d}|j|�}tjd�}|jd|�}|j�|fS)z&Returns pydoc generated output as textrz
MODULE DOCS
    rz.)	r r5r*rr)�re�compile�subr")r+r,r.r-Zpattrrr�get_pydoc_textqs

r:cCs4|jd�\}}}|jd�\}}}|jd�\}}}|S)Nz</head>z<title>z</title>)�	partition)�text�header�_�titlerrr�get_html_titlesr@c@s.eZdZddd�Zejd	dd��Zdd�ZdS)
�
PydocBaseTestNcs&|ptjjt�g�d��fdd�	}|S)zi
        A version of pkgutil.walk_packages() that will restrict itself to
        a given path.
        Nrcs�|p�||�S)Nr)r2�prefix�onerror)�default_path�
walk_packagesrr�wrapper�sz8PydocBaseTest._restricted_walk_packages.<locals>.wrapper)NrN)r1r2r3r!)�selfrEr2rFr)rDrEr�_restricted_walk_packages�sz'PydocBaseTest._restricted_walk_packagesccs,tj}|j||�t_z
dVWd|t_XdS)N)�pkgutilrErH)rGr2rErrr�restrict_walk_packages�s
z$PydocBaseTest.restrict_walk_packagescCs&tj|d�}t|�}|j|||�|S)Nz	text/html)r �_url_handlerr@�assertEqual)rG�urlZexpected_titler<�resultrrr�call_url_handler�szPydocBaseTest.call_url_handler)N)N)rrrrH�
contextlib�contextmanagerrJrOrrrrrA�s

	rAc@s�eZdZdZejejjdkd�eje	ed�o2ej
�d�edd����Zejejjdkd�eje	ed�olej
�d�edd	����Z
d
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zejejjdkd�dd��Zdd�Zdd�Zejejjdkd�eje	ed��oej
�d�edd����Zdd �Zd!d"�Zejejjdkd�d#d$��Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Z d1d2�Z!dS)3�PydocDocTestNrz)Docstrings are omitted with -O2 and above�gettracez1trace function introduces __locals__ unexpectedlycCsDtt�\}}tjt�}tjj|�}t|||ft}|j	||�dS)N)
r/r�inspect�
getabsfile�urllib�parseZquote�expected_html_pattern�expected_html_data_docstringsrL)rGrN�doc_locZmod_fileZmod_urlZ
expected_htmlrrr�
test_html_doc�s
zPydocDocTest.test_html_doccCs6tt�\}}t|fttjt�f}|j||�dS)N)r:r�expected_text_pattern�expected_text_data_docstringsrTrUrL)rGrNrZ�
expected_textrrr�
test_text_doc�s
zPydocDocTest.test_text_doccCs4ddl}Gdd�d|j�}tj|�}|jd|�dS)Nrc@seZdZdZdZdS)zIPydocDocTest.test_text_enum_member_with_value_zero.<locals>.BinaryIntegerr�N)rrrZzero�onerrrr�
BinaryInteger�srbz<BinaryInteger.zero: 0>)�enum�IntEnumr �
render_doc�assertIn)rGrcrbr,rrr�%test_text_enum_member_with_value_zero�s
z2PydocDocTest.test_text_enum_member_with_value_zerocCsttjj�}|jd|�dS)Nzxml.etree.elementtree)r6�xml�etreeZElementTreerf)rGZdoc_linkrrr�,test_mixed_case_module_names_are_lower_cased�sz9PydocDocTest.test_mixed_case_module_names_are_lower_casedcCs ttj�\}}|j|dd�dS)Nrz'MODULE DOCS incorrectly includes a link)r:rhrirL)rGrNrZrrr�test_issue8225�szPydocDocTest.test_issue8225cCs&tj}zdt_tj�Wd|t_XdS)N)�sys�stdinr �getpager)rGZprevious_stdinrrr�test_getpager_with_stdin_none�s
z*PydocDocTest.test_getpager_with_stdin_nonecCsLGdd�d�}Gdd�d�}tj|��}tj|��}|j|jdd�|�dS)Nc@seZdZdZdS)z)PydocDocTest.test_non_str_name.<locals>.A�*N)rrrrrrr�A�srqc@seZdZdS)z)PydocDocTest.test_non_str_name.<locals>.BN)rrrrrrr�B�srr)r rerLr)rGrqrrZadocZbdocrrr�test_non_str_name�s
zPydocDocTest.test_non_str_namecCs,d}tt|�d�}t|}|j||d�dS)Nztest.i_am_not_here�asciiz&documentation for missing module found)�strr'�missing_patternrL)rG�missing_modulerN�expectedrrr�
test_not_here�s
zPydocDocTest.test_not_herez)Docstrings are omitted with -OO and abovecCs*tddd�}tjjdd�}|j||�dS)Nztest.test_pydoc.nonasciirt)ZPYTHONIOENCODING�backslashreplace)r'rr�encoderf)rGrNZencodedrrr�test_not_ascii�szPydocDocTest.test_not_asciicCs.d}tt|�d�}t|j�}|j||�dS)Nz test.i_am_not_here rt)rur'rvr"rL)rGrwrNrxrrr�test_input_strip�szPydocDocTest.test_input_stripcCsJtj}|j|d�d�|j|d�d�|j|d�d�|j|d�d�dS)Nz<function stripid at 0x88dcee4>z<function stripid>z <function stripid at 0x01F65390>Z42z<type 'exceptions.Exception'>)r �stripidrL)rGr~rrr�test_stripid�s


zPydocDocTest.test_stripidcCs�t}tj}dd�}d|_t�}tj|d�}tt�\}}d}dj�}	t	j
|	�}	|	t}
|t_z�td��v}td��b}|j|�|j
�j�}
|
|fttjt�f}|jd|j
��|jd|j
��|j||
�WdQRXWdQRXWd|t_XdS)	NcSsdd�S)NcSs|S)Nr)�xrrr�<lambda>szJPydocDocTest.test_help_output_redirect.<locals>.<lambda>.<locals>.<lambda>rrrrrr�sz8PydocDocTest.test_help_output_redirect.<locals>.<lambda>)r-ztest.pydoc_modz9
        Help on module test.pydoc_mod in test:

        �stdout�stderrr)r\r rn�maxDiffr�Helperr:r�lstrip�textwrap�dedentr	�help�getvaluer"r]rTrUrL)rGZold_patternZgetpager_oldZgetpager_newZbuf�helperZunusedrZr+Zhelp_headerZexpected_help_patternr-r&rNr^rrr�test_help_output_redirects0



$z&PydocDocTest.test_help_output_redirectc
Cs^tdddgdd�}t��}tj|�WdQRX|j�}|jd|�|jd|�|jd|�dS)	N�NT�abc�defT)�renameZ_1�_replace�_asdict)rr
r r�r�rf)rGr��help_io�helptextrrr�!test_namedtuple_public_underscore3sz.PydocDocTest.test_namedtuple_public_underscorecCs�|jtt�xpd
D]h}ttd|d��8}|dkr@tdj|�|d�td|d�td|d�WdQRXtjti�}|j|d	�qWdS)N�
ISO-8859-1�UTF-8�w)�encodingz#coding: {})�fileu"""line 1: héz
line 2: hi"""uline 1: hé)r�r�)	�
addCleanuprr�open�print�formatr �synopsisrL)rGr�Zscriptr�rrr�
test_synopsis<s
zPydocDocTest.test_synopsiscCs.tjj�d}tj}tj|�}|j||�dS)Nr)r1r�
splitlines�
__cached__r r�rL)rGrx�filenamer�rrr�test_synopsis_sourcelessGs
z%PydocDocTest.test_synopsis_sourcelesscCs�tjj��v}tjj|d�}tjj|�}t	|d��}|j
d�WdQRXtj|�t
j|i�}|j|�t
j|i�}|j|�WdQRXdS)Nzfoomod42.pyr�zfoo = 1)�test�support�temp_cwdr1r2�join�	importlib�util�cache_from_sourcer��write�
py_compiler8r r��assertIsNone)rG�test_dir�	init_pathZcached_path�fobjr�Zsynopsis_cachedrrr�"test_synopsis_sourceless_empty_docPs

z/PydocDocTest.test_synopsis_sourceless_empty_doccCsd}|jtj|�d�dS)Nz#I Am A Doc


Here is my description�
I Am A Doc�
Here is my description)r�r�)rLr Zsplitdoc)rGZexample_stringrrr�test_splitdoc_with_description\sz+PydocDocTest.test_splitdoc_with_descriptioncCs@tj�}|jtj|j��|jtjtj��|jtjd��dS)NzI am not a method)r ZDoc�
assertTrueZ_is_some_method�fail�int�__add__�assertFalse)rGr,rrr�test_is_object_or_methodasz%PydocDocTest.test_is_object_or_methodc
Cs*tjj��}|jtj|��WdQRXdS)N)r�r�r�r�r �	ispackage)rGr�rrr� test_is_package_when_not_packagejsz-PydocDocTest.test_is_package_when_not_packagec
CsPtjj��<}tjj|d�}t|d�j�|jt	j
|��tj|�WdQRXdS)Nz__init__.pyr�)r�r�r�r1r2r�r��closer�r r��remove)rGr�r�rrr�test_is_package_when_is_packagens
z,PydocDocTest.test_is_package_when_is_packagecCs`Gdd�dt�}ttt��}|j|d<|d=|d=|j|d<|j|d<tj|�}|j||�dS)Nc@seZdZdd�ZdS)z/PydocDocTest.test_allmethods.<locals>.TestClasscSsdS)NTr)rGrrr�method_returning_true|szEPydocDocTest.test_allmethods.<locals>.TestClass.method_returning_trueN)rrrr�rrrr�	TestClass{sr�r�r�	__class__�__subclasshook__�__init_subclass__)	�object�dict�varsr�r�r�r Z
allmethodsZassertDictEqual)rGr�rx�methodsrrr�test_allmethodsus



zPydocDocTest.test_allmethodscspGdd�d��G�fdd�d��}tj|�}tjdd|�}|j|dt�tj|tj�d�}|j|d	t�dS)
Nc@s"eZdZddd�ZeZdd�ZdS)z+PydocDocTest.test_method_aliases.<locals>.ANcSsdS)z(Raise this widget in the stacking order.Nr)rGZ	aboveThisrrr�tkraise�sz3PydocDocTest.test_method_aliases.<locals>.A.tkraisecSsdS)zReturn sizeNr)rGrrr�a_size�sz2PydocDocTest.test_method_aliases.<locals>.A.a_size)N)rrrr�Zliftr�rrrrrq�s
rqcs eZdZddd�ZeZ�jZdS)z+PydocDocTest.test_method_aliases.<locals>.BNc[sdS)z'Configure resources of an item TAGORID.Nr)rGZtagOrIdZcnf�kwrrr�
itemconfigure�sz9PydocDocTest.test_method_aliases.<locals>.B.itemconfigure)N)rrrr�Z
itemconfigr�Zb_sizer)rqrrrr�s
rrz.ra�Python Library Documentation: class B in module %s

class B(A)
 |  Method resolution order:
 |      B
 |      A
 |      builtins.object
 |  
 |  Methods defined here:
 |  
 |  b_size = a_size(self)
 |  
 |  itemconfig = itemconfigure(self, tagOrId, cnf=None, **kw)
 |  
 |  itemconfigure(self, tagOrId, cnf=None, **kw)
 |      Configure resources of an item TAGORID.
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from A:
 |  
 |  a_size(self)
 |      Return size
 |  
 |  lift = tkraise(self, aboveThis=None)
 |  
 |  tkraise(self, aboveThis=None)
 |      Raise this widget in the stacking order.
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from A:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)
)ZrendereraPython Library Documentation: class B in module %s

<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="B">class <strong>B</strong></a>(A)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%"><dl><dt>Method resolution order:</dt>
<dd>B</dd>
<dd>A</dd>
<dd><a href="builtins.html#object">builtins.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="B-b_size"><strong>b_size</strong></a> = <a href="#B-a_size">a_size</a>(self)</dt></dl>

<dl><dt><a name="B-itemconfig"><strong>itemconfig</strong></a> = <a href="#B-itemconfigure">itemconfigure</a>(self, tagOrId, cnf=None, **kw)</dt></dl>

<dl><dt><a name="B-itemconfigure"><strong>itemconfigure</strong></a>(self, tagOrId, cnf=None, **kw)</dt><dd><tt>Configure&nbsp;resources&nbsp;of&nbsp;an&nbsp;item&nbsp;TAGORID.</tt></dd></dl>

<hr>
Methods inherited from A:<br>
<dl><dt><a name="B-a_size"><strong>a_size</strong></a>(self)</dt><dd><tt>Return&nbsp;size</tt></dd></dl>

<dl><dt><a name="B-lift"><strong>lift</strong></a> = <a href="#B-tkraise">tkraise</a>(self, aboveThis=None)</dt></dl>

<dl><dt><a name="B-tkraise"><strong>tkraise</strong></a>(self, aboveThis=None)</dt><dd><tt>Raise&nbsp;this&nbsp;widget&nbsp;in&nbsp;the&nbsp;stacking&nbsp;order.</tt></dd></dl>

<hr>
Data descriptors inherited from A:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table>)r rer7r9rLrr()rGrrr,r)rqr�test_method_aliases�s
%
(z PydocDocTest.test_method_aliases)"rrrr��unittest�skipIfrl�flags�optimize�hasattrrSr
r[r_rgrjrkrorsryr|r}rr�r�r�r�r�r�r�r�r�r�r�rrrrrR�sJ
	

$		rRc@szeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	j
d
�dd��Ze	j
d
�dd��Ze	j
d�dd��Z
dd�ZdS)�PydocImportTestcCs$tjt�|_|jtt�tj�dS)N)r1�mkdirrr�r�rr��invalidate_caches)rGrrr�setUp�szPydocImportTest.setUpc	Cs�d}d
dddj|�dfdj|�dj|�ff}tjjt|�tjd}x`|D]X\}}t|d	��}|jd
j|��WdQRXt|td�j	d�}t
||f}|j||�qJWdS)NZ
testmod_xyzzy�
i_am_not_here�test.i_am_not_here_either�test.i_am_not_here.neither_am_i�test.i_am_not_herezi_am_not_here.{}ztest.{}�pyr�z
import {}
)�
PYTHONPATHrt)r�r�)r�r�)r�r�)r�r1r2r�r�extsepr�r�r'�decode�badimport_patternrL)	rG�modnameZ	testpairsZsourcefnZimportstringZ
expectedinmsg�frNrxrrr�test_badimport�szPydocImportTest.test_badimportc-Cstjjtd�}tj|�tjj|d�tjd}t|d��}|jd�WdQRX|jtgd���t	��"}t
��}tjd�WdQRXWdQRX|j
|j�d�|j
|j�d�t	��"}t
��}tjd�WdQRXWdQRX|j
|j�j�d�|j
|j�d�WdQRXdS)	NZ	syntaxerr�__init__r�r�zinvalid python syntax = $1
)r2Zxyzzyr)r1r2r�rr�r�r�r�rJr
rr �aproposrLr�r")rG�pkgdirZ	badsyntaxr�r%r&rrr�test_apropos_with_bad_package
s 
z-PydocImportTest.test_apropos_with_bad_packagecCs�tjjtd�|_tj|jd�|jtj|j�|jtgd��4t	��"}t
��}tjd�WdQRXWdQRXWdQRX|j
|j�d�|j
|j�d�dS)NZ
unreadabler)r2ZSOMEKEYr)r1r2r�rZunreadable_dirr�r��rmdirrJr
rr r�rLr�)rGr%r&rrr� test_apropos_with_unreadable_dir"s(z0PydocImportTest.test_apropos_with_unreadable_dircCs�tjjtd�}tj|�|jt|�tjj|d�}t|d��}|jd�WdQRXt	j
tj	|�j�}z^tj||t	j
@�|jtgd��"t��}tjd�WdQRXWdQRX|jd|j��Wdtj||�XdS)NZwalkpkgz__init__.pyr�zfoo = 1)r2r)r1r2r�rr�r�rr�r��stat�S_IMODE�st_mode�chmod�S_IEXECrJr
r r�rfr�)rGr�r�r�Zcurrent_moder�rrr�test_apropos_empty_doc1s
z&PydocImportTest.test_apropos_empty_docc Cs�tjjtd�}tj|�tjj|d�}t|ddd��}|jd�WdQRX|jtgd��ptt	j�}t	jj
dt�z@|jtd	��ddl
}WdQRX|jd
d�}d}|j||�Wd|t	jdd�<XWdQRXdS)
N�test_error_packagez__init__.pyZwtrt)r�zraise ValueError("ouch")
)r2rZouchzsearch?key=test_error_packagezPydoc: Search Resultsz8<a href="test_error_package.html">test_error_package</a>)r1r2r�rr�r�r�rJ�tuplerl�insertZassertRaisesRegex�
ValueErrorr�rOrf)rGr�Zinitr�Zsaved_pathsr�r<�foundrrr�test_url_search_package_errorAs 

z-PydocImportTest.test_url_search_package_errorz(causes undesirable side-effects (#20128)c	CsZd}d}d}|||}t�}tj|d�}|d�|j�j�}t|j��}|j||�dS)Nr��)r-�modules)rr r�r�r"�lenr�ZassertGreaterEqual)	rGZnum_header_linesZnum_module_lines_minZnum_footer_linesrxr-r�rNZ	num_linesrrr�test_modulesXszPydocImportTest.test_modulesc
CsHd}t�}tj|d�}t��}|d�WdQRX|j�}|j||�dS)Nzpydoc - )r-z
modules pydoc)rr r�r
r�rf)rGrxr-r�r�rNrrr�test_modules_searchhsz#PydocImportTest.test_modules_searchz+some buildbots are not cooperating (#20128)c
CsLd}t�}tj|d�}t��}|d�WdQRX|j�}|j|j|��dS)Nzgc - )r-zmodules garbage)rr r�r
r�r��
startswith)rGrxr-r�r�rNrrr�test_modules_search_builtinusz+PydocImportTest.test_modules_search_builtincCsJtjtj�}|j|t�|j|jd�|j|jtj�|j|jtj�dS)Nr )r Z
importfiler!ZassertIsNotrLr�__spec__)rGZloaded_pydocrrr�test_importfile�s
zPydocImportTest.test_importfileN)rrrr�r�r�r�r�r�r��skipr�r�r�rrrrrr��s
r�c@steZdZdd�Zdd�Zdd�Zdd�Zed	d
��Zdd�Z	e
d
d��Zdd�Zdd�Z
e
dd��Ze
dd��ZdS)�TestDescriptionscCs&ddlm}tj|�}|jd|�dS)Nr)�pydocfodderr)r�rr rerf)rGrr,rrr�test_module�s
zTestDescriptions.test_modulecCsVGdd�d�}|�}|jtj|�d�|jtj|�d�dt}|j|tj|��dS)Nc@seZdZdZdS)z&TestDescriptions.test_class.<locals>.CzNew-style classN)rrrrrrrr�C�srzclass CzC in module %s object)rLr Zdescriberrfre)rGr�crxrrr�
test_class�szTestDescriptions.test_classcCs�tjtjttjtjttjfd�dd�}tjd�}Gdd�dtj|tjtt	f�}|j
tj|�j
�dd�|j
tj|�j
�d	d
�dS)N)�datar��returncSsdS)Nr)rr�rrr�foo�sz/TestDescriptions.test_typing_pydoc.<locals>.foo�Tc@seZdZdS)z-TestDescriptions.test_typing_pydoc.<locals>.CN)rrrrrrrr�srr`z=ffoooo(data:List[Any], x:int) -> Iterator[Tuple[int, Any]]rzclass CC(typing.Mapping)���)�typingZListZAnyr��IteratorZTupleZTypeVarZGeneric�MappingrurLr rer�)rGr
rrrrr�test_typing_pydoc�s
"
"z"TestDescriptions.test_typing_pydoccCs�xPdD]H}|jtj|��ytj|�Wqtk
rL|jdj|��YqXqWx,d
D]$}|jtj|��|jttj|�qXWdS)Nru�
str.translate�builtins.str�builtins.str.translatezfinding the doc of {!r} failed�notbuiltins�strrr�strr.translate�str.trrrranslate�builtins.strrr�builtins.str.trrranslate)rurrr)rrrrrr)	ZassertIsNotNoner Zlocatere�ImportErrorr�r�r��assertRaises)rG�namerrr�test_builtin�szTestDescriptions.test_builtincCs2tjtj|��}|jd�}t|�dks*t�|dS)Nrr)r Zplainre�splitr��AssertionError)�or<�linesrrr�_get_summary_line�s
z"TestDescriptions._get_summary_linecCs|j|jtjj�d�dS)Nzwrap(self, text))rLr"r��TextWrapper�wrap)rGrrr�test_unbound_python_method�sz+TestDescriptions.test_unbound_python_methodcCs|j|jtjj�d�dS)Nzdump(self, obj, /))rLr"�_pickle�Pickler�dump)rGrrr�test_unbound_builtin_method�sz,TestDescriptions.test_unbound_builtin_methodcCs tj�}|j|j|j�d�dS)Nz2wrap(text) method of textwrap.TextWrapper instance)r�r#rLr"r$)rG�trrr�test_bound_python_method�sz)TestDescriptions.test_bound_python_methodcCs~tddddg�}tj|�}|j|jd�|jd��|j|jd�|jd��Gdd�d�}Gdd�d�}tj|�tj|�dS)	N�PersonZnicknameZ	firstnameZagegroupc@seZdZdZdS)zMTestDescriptions.test_field_order_for_named_tuples.<locals>.NonIterableFieldsN)rrr�_fieldsrrrr�NonIterableFields�sr.c@seZdZggZdS)zMTestDescriptions.test_field_order_for_named_tuples.<locals>.NonHashableFieldsN)rrrr-rrrr�NonHashableFields�sr/)rr reZ
assertLess�index)rGr,rr.r/rrr�!test_field_order_for_named_tuples�s

z2TestDescriptions.test_field_order_for_named_tuplescCs(t�}tj|�}|j|j|j�d�dS)Nz/dump(obj, /) method of _pickle.Pickler instance)rr&r'rLr"r()rGr�prrr�test_bound_builtin_method�s
z*TestDescriptions.test_bound_builtin_methodcCs|j|jtj�d�dS)Nz0stat(path, *, dir_fd=None, follow_symlinks=True))rLr"r1r�)rGrrr�test_module_level_callable�sz+TestDescriptions.test_module_level_callableN)rrrrrrr�staticmethodr"r%r
r)r+r1r3r4rrrrr�s	rz!Threading required for this test.c@seZdZdZdd�ZdS)�PydocServerTestzTests for pydoc._start_servercCszdd�}tj|dd�}|jd|jj�tj�}d}x4|jrftjd�|jr4tj�||kr4|j�Pq4W|j	|j
d�dS)NcSsd||f}|S)Nzthe URL sent was: (%s, %s)r)rMZcontent_typer<rrr�my_url_handler�sz3PydocServerTest.test_server.<locals>.my_url_handlerr)ZportZ	localhostr`g{�G�z�?)r Z
_start_serverrfZ	docserverZaddress�timeZservingZsleep�stoprL�error)rGr7ZserverthreadZ	starttimeZtimeoutrrr�test_server�s
zPydocServerTest.test_serverN)rrrrr;rrrrr6�sr6c@s eZdZdZdd�Zdd�ZdS)�PydocUrlHandlerTestzTests for pydoc._url_handlercCs*tj}|jt|dd�|jt|dd�dS)Nrqrrr�foobar)r rKr�	TypeError)rGr�rrr�test_content_type_err
sz)PydocUrlHandlerTest.test_content_type_errc
Cstddddddddd d!d"d#g}|j��Fx|D]\}}|j||�q,Wtj}d|}d|}|j||�WdQRXdS)$Nr�Pydoc: Index of Modules�get?key=r0�topics�
Pydoc: Topics�keywords�Pydoc: Keywordsr �Pydoc: module pydoc�
get?key=pydoc�search?key=pydoc�Pydoc: Search Results�
topic?key=def�Pydoc: KEYWORD def�topic?key=STRINGS�Pydoc: TOPIC STRINGSr=�Pydoc: Error - foobar�getfile?key=foobar�!Pydoc: Error - getfile?key=foobarzPydoc: getfile zgetfile?key=)rr@)rAr@)r0r@)rBrC)rDrE)r rF)rGrF)rHrI)rJrK)rLrM)r=rN)rOrP)rJrO�stringr!)rGZrequestsrMr?r2rrr�test_url_requestss&
z%PydocUrlHandlerTest.test_url_requestsN)rrrrr?rRrrrrr<sr<c@seZdZdd�ZdS)�
TestHelpercCs|jttjj�ttj��dS)N)rL�sortedr r�rD�keyword�kwlist)rGrrr�
test_keywords-szTestHelper.test_keywordsN)rrrrWrrrrrS,srSc@s�eZdZejejjdkd�ejeed�o.ej	�d�dd���Z
ejejjdkd�ejeed�odej	�d�dd���Zejejjdkd�ejeed�o�ej	�d�d	d
���Zejejjdkd�ejeed�o�ej	�d�dd���Z
d
d�ZdS)�PydocWithMetaClassesrz)Docstrings are omitted with -O2 and aboverSz1trace function introduces __locals__ unexpectedlycCs�Gdd�dt�}Gdd�d|d�}tdd�tD��}t�}tj|d�}||�ttf|dd	�}|j�j	�}|j
||�dS)
NcseZdZ�fdd�Z�ZS)z=PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Metacs|dkrdSt�j|�S)N�hamZspam)�super�__getattr__)rGr)r�rrr[8szIPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Meta.__getattr__)rrrr[�
__classcell__rr)r�r�Meta7sr]c@seZdZejdd��ZdS)z;PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DAcSsdS)NZeggsr)rGrrrrY=sz?PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DA.hamN)rrr�types�DynamicClassAttributerYrrrr�DA<sr`)�	metaclasscss|]}|rd|ndVqdS)z	
 |      rNr)rrrrrr@szBPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.<genexpr>)r-r)�typer��expected_data_docstringsrr r��!expected_dynamicattribute_patternrr�r"rL)rGr]r`r]r-r�r^rNrrr�test_DynamicClassAttribute2s
z/PydocWithMetaClasses.test_DynamicClassAttributecCs`Gdd�dt�}Gdd�d|d�}t�}tj|d�}||�tt}|j�j�}|j||�dS)Ncs$eZdZdd�Z�fdd�Z�ZS)zHPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.MetacSsddddgS)Nr�rr�LIFEr)�clsrrr�__dir__PszPPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__dir__cs|dkrdSt�j|�S)Nrfrp)rZZ_Meta__getattr)rGr)r�rrr[RszTPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__getattr__)rrrrhr[r\rr)r�rr]Osr]c@seZdZdS)zIPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.ClassN)rrrrrrr�ClassVsri)ra)r-)	rbrr r��"expected_virtualattribute_pattern1rr�r"rL)rGr]rir-r�r^rNrrr�%test_virtualClassAttributeWithOneMetaJsz:PydocWithMetaClasses.test_virtualClassAttributeWithOneMetacs�Gdd�dt��Gdd�dt��G��fdd�d���}Gdd�d�d	�}Gd
d�d||d	�}d}}t�}tj|d
�}||�tt}|j�j�}	|j||	�t�}tj|d
�}||�t	t}
|j�j�}|j|
|�dS)Ncs$eZdZdd�Z�fdd�Z�ZS)zIPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1cSsddddgS)Nr�rrrar)rgrrrrheszQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__dir__cs|dkrdSt�j|�S)Nrar`)rZr[)rGr)r�rrr[gszUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__getattr__)rrrrhr[r\rr)r�r�Meta1dsrlcs$eZdZdd�Z�fdd�Z�ZS)zIPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2cSsddddgS)Nr�rr�twor)rgrrrrhlszQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__dir__cs|dkrdSt�j|�S)Nrmr)rZr[)rGr)r�rrr[nszUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__getattr__)rrrrhr[r\rr)r�r�Meta2ksrncs*eZdZ��fdd�Z�fdd�Z�ZS)zIPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3cs,tttddddg�j|��j|����S)Nr�rr�three)�listrT�setrh)rg)rlrnrrrhsszQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__dir__cs|dkrdSt�j|�S)Nror�)rZr[)rGr)r�rrr[wszUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__getattr__)rrrrhr[r\r)rlrn)r�r�Meta3rsrrc@seZdZdS)zJPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class1N)rrrrrrr�Class1{srs)rac@seZdZdS)zJPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class2N)rrrrrrr�Class2}srtF)r-)
rbrr r��"expected_virtualattribute_pattern2rr�r"rL�"expected_virtualattribute_pattern3)rGrrrsrtZfail1Zfail2r-r�Zexpected_text1Zresult1Zexpected_text2Zresult2r)rlrnr�%test_virtualClassAttributeWithTwoMeta_s$	z:PydocWithMetaClasses.test_virtualClassAttributeWithTwoMetacCs`Gdd�dt�}Gdd�d|d�}t�}tj|d�}||�tt}|j�j�}|j||�dS)Nc@seZdZdd�ZdS)z.PydocWithMetaClasses.test_buggy_dir.<locals>.McSsddddgS)Nr�rZmissing�herer)rgrrrrh�sz6PydocWithMetaClasses.test_buggy_dir.<locals>.M.__dir__N)rrrrhrrrr�M�sryc@seZdZdZdS)z.PydocWithMetaClasses.test_buggy_dir.<locals>.Czpresent!N)rrrrxrrrrr�sr)ra)r-)	rbrr r��!expected_missingattribute_patternrr�r"rL)rGryrr-r�r^rNrrr�test_buggy_dir�sz#PydocWithMetaClasses.test_buggy_dirc
Cs4t��}tjd�WdQRX|j�}|jd|�dS)Nz	enum.Enumz
class Enum)r
r r�r�rf)rGr�r�rrr�test_resolve_false�sz'PydocWithMetaClasses.test_resolve_falseN)rrrr�r�rlr�r�r�rSrerkrwr{r|rrrrrX1s"+rXcCs*ztjjttttttt	�Wdt
�XdS)N)r�r�Zrun_unittestrRr�rr6r<rSrXrrrrr�	test_main�s
r}�__main__)rr)rrrr)rrrr)Qr1rl�builtinsrP�importlib.utilr�rTr r�rUr&rIr7r�rQZtest.supportr�r8r^r
r�Zurllib.parserVZ	xml.etreerhZxml.etree.ElementTreer��ior�collectionsrZtest.support.script_helperrrrrrr	r
rrr
rZ	threadingrrr�ZHAVE_DOCSTRINGSrcr"r\r�r]rXrYr�lineseprvr�rdrjrurvrzr'r/r6r:r@ZTestCaserArRr�rZ
skipUnlessr6r<rSrXr}rrrrr�<module>s�,

T
{
			
	Nc
%v


Youez - 2016 - github.com/yon3zu
LinuXploit