Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_pydoc/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_pydoc/__pycache__/test_pydoc.cpython-312.opt-1.pyc

�

)Μg����ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlmZm Z ddlm!Z!ddlm"Z"ddlm#Z#ddl$m%Z%m&Z&m'Z'dd	lm(Z(dd
lm)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2m3Z3m4Z4ddl5m6Z6dd
l5m7Z7Gd�d�Z8ejBjrrdZ:ndZ:djw�Z<e=d�e:D��Z>dZ?e=d�e:D��Z@dj�dej��ZCdZDdjw�ZEdjw�ZFdjw�ZGdjw�ZHdjw�ZId�ZJd�ZKd �ZLd!�ZMd"�ZNd#�ZOd$�ZPd%�ZQGd&�d'ej��ZSGd(�d)ej��ZTGd*�d+eS�ZUGd,�d-ej��ZVGd.�d/ej��ZWej�e-xse.d0�Gd1�d2ej���ZYGd3�d4eS�ZZGd5�d6ej��Z[Gd7�d8ej��Z\Gd9�d:ej��Z]d;�Z^e_d<k(rej��yy)=�N)�StringIO)�
namedtuple)�urlopen�
urlcleanup)�support)�
import_helper)�	os_helper)�assert_python_ok�assert_python_failure�spawn_python)�threading_helper)�
reap_children�captured_output�captured_stdout�captured_stderr�
is_emscripten�is_wasi�requires_docstrings�MISSING_C_DOCSTRINGS)�TESTFN�rmtree�unlink)�	pydoc_mod)�pydocfodderc��eZdZdZy)�nonasciiuЦе не латиницяN��__name__�
__module__�__qualname__�__doc__���7/usr/local/lib/python3.12/test/test_pydoc/test_pydoc.pyrr(s�� �r#r)�!dictionary for instance variables�%list of weak references to the objectr%r&)�r'r'r'a�
NAME
    test.test_pydoc.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)
     |
     |  ----------------------------------------------------------------------
     |  Class methods defined here:
     |
     |  __class_getitem__(item)
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables
     |
     |  __weakref__
     |      list of weak references to the object

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'
    c_alias = test.test_pydoc.pydoc_mod.C[int]
    list_alias1 = typing.List[int]
    list_alias2 = list[int]
    type_union1 = typing.Union[int, str]
    type_union2 = int | str

VERSION
    1.2.3.4

AUTHOR
    Benjamin Peterson

CREDITS
    Nobody

FILE
    %s
c#�.K�|]
}|rd|znd���y�w)z
     |      r'Nr"��.0�ss  r$�	<genexpr>r,�s'����&I�/G�!�?@�&6��&:�R�&G�/G���a{
test.test_pydoc.pydoc_mod (version 1.2.3.4)
This is a test module for test_pydoc

Modules
    types
    typing

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__
            dictionary for instance variables
        __weakref__
            list of weak references to the object

class B(builtins.object)
    Data descriptors defined here:
        __dict__
            dictionary for instance variables
        __weakref__
            list of weak references to the object
    ----------------------------------------------------------------------
    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)
    ----------------------------------------------------------------------
    Class methods defined here:
        __class_getitem__(item)
    ----------------------------------------------------------------------
    Data descriptors defined here:
        __dict__
            dictionary for instance variables
        __weakref__
             list of weak references to the object

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'
    c_alias = test.test_pydoc.pydoc_mod.C[int]
    list_alias1 = typing.List[int]
    list_alias2 = list[int]
    type_union1 = typing.Union[int, str]
    type_union2 = int | str

Author
    Benjamin Peterson

Credits
    Nobody
c#�@K�|]}|jdd����y�w)� �&nbsp;N)�replacer)s  r$r,r,�s$����&I�/G�!�'(�i�i��X�&>�/G�s�z~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!'
c�r�||fz}tdtjg|��i|��\}}}|j�S)zW
    Runs pydoc on the specified module. Returns the stripped
    output of pydoc.
    �-B)r
�pydoc�__file__�strip��module_name�args�env�rc�out�errs      r$�	run_pydocr?5s<��
�;�.� �D�#�D�%�.�.�G�4�G�3�G�L�B��S��9�9�;�r#c�r�||fz}tdtjg|��i|��\}}}|j�S)zA
    Runs pydoc on the specified module expecting a failure.
    r4)rr5r6r7r8s      r$�run_pydoc_failrA?s<���;�.� �D�(��u�~�~�L��L��L�L�B��S��9�9�;�r#c��tj�}|j|�}|jt�xsd}|rd|zdz}|j�|fS)z&Returns pydoc generated output as htmlr'z
<br><a href="z">Module Docs</a>)r5�HTMLDoc�	docmodule�	getdoclocrr7)�module�doc�output�locs    r$�get_pydoc_htmlrJGsR��
�-�-�/�C�
�]�]�6�
"�F�

�-�-�	�
"�
(�b�C�
���$�';�;���<�<�>�3��r#c�0�tjdd|�S)Nz.r')�re�sub)rGs r$�
clean_textrNPs��
�6�6�%��S�!�!r#c	��tjj}tjj}||||t����}tj�}|j||��}|S)z,Returns a documentation web link of a module)�basedir)�os�path�abspath�dirnamer6r5�TextDocrE)rFrSrTrPrGrIs      r$�get_pydoc_linkrVTsW���g�g�o�o�G��g�g�o�o�G��g�g�g�h�&7�8�9�:�G�
�-�-�/�C�

�-�-���-�
0�C��Jr#c���tj�}|jt�xsd}|rd|zdz}|j	|�}t|�}|j
�|fS)z&Returns pydoc generated output as textr'z
MODULE DOCS
    r2)r5rUrErrDrNr7)rFrGrIrHs    r$�get_pydoc_textrX]s[��
�-�-�/�C�

�-�-�	�
"�
(�b�C�
�#�c�)�D�0��
�]�]�6�
"�F�
��
�F��<�<�>�3��r#c��|jd�\}}}|jd�\}}}|jd�\}}}|S)Nz</head>z<title>z</title>)�	partition)�text�header�_�titles    r$�get_html_titler_hsE���>�>�)�,�L�F�A�q��"�"�9�-�K�A�q�%��/�/�*�-�K�E�1�a��Lr#c	��|jdd�}|jdd�}tjdd|�}tj|ddd	d
dd�}|S)
zWA quick and dirty implementation of html2text.

    Tailored for pydoc tests only.
    z<dd>r2z<hr>�F----------------------------------------------------------------------z<.*?>r'r0r/z&gt;�>z&lt;�<)r1rLrMr5)�htmls r$�	html2textrepsU��
�<�<���%�D��<�<���'�D�
�6�6�'�2�t�$�D��=�=��x��f�c�6�3�G�D��Kr#c�F�eZdZd�Zdd�Zejdd��Zd�Zy)�
PydocBaseTestc�R�|jtjdt�y�Nr5��assertIs�sys�modulesr5��selfs r$�tearDownzPydocBaseTest.tearDown}s��	
�
�
�c�k�k�'�*�E�2r#Nc�h���|xs$tjjt�g�d��fd�	}|S)zi
        A version of pkgutil.walk_packages() that will restrict itself to
        a given path.
        c� ���|xs�||�S�Nr")rR�prefix�onerror�default_path�
walk_packagess   ��r$�wrapperz8PydocBaseTest._restricted_walk_packages.<locals>.wrapper�s��� ��!5��v�w�G�Gr#)Nr'N)rQrRrTr6)rorwrRrxrvs `  @r$�_restricted_walk_packagesz'PydocBaseTest._restricted_walk_packages�s*���
�:������� 9�:��	H��r#c#�K�tj}|j||�t_	d��|t_y#|t_wxYw�wrs)�pkgutilrwry)rorRrws   r$�restrict_walk_packagesz$PydocBaseTest.restrict_walk_packages�sB�����-�-�
� $� >� >�}�?C�!E���	2��$1�G�!��M�G�!�s�,A�?�A�
A�Ac�n�tj|d�}t|�}|j|||�|S)Nz	text/html)r5�_url_handlerr_�assertEqual)ro�url�expected_titler[�results     r$�call_url_handlerzPydocBaseTest.call_url_handler�s5���!�!�#�{�3����%��������6��r#rs)	rrr rpry�
contextlib�contextmanagerr|r�r"r#r$rgrg|s+��3�����2��2�r#rgc��eZdZdZd�Zejeed�xrej�d�e
d���Zejeed�xrej�d�e
d���Zd�Z
d�Zd	�Zd
�Zd�Zd�Ze
d
��Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zejeed�xrej�d�ej:j=d�e
d����Zejeed�xrej�d�e
ej:j=d�d����Z d�Z!d�Z"ej:j=d�d��Z#ejeed�xrej�d�e
ej:j=d�d����Z$d�Z%d�Z&d �Z'd!�Z(d"�Z)d#�Z*e
d$��Z+d%�Z,d&�Z-d'�Z.d(�Z/d)�Z0e
d*��Z1d+�Z2y),�PydocDocTestNc�R�|jtjdt�yrirjrns r$rpzPydocDocTest.tearDown�����
�
�c�k�k�'�*�E�2r#�gettrace�1trace function introduces __locals__ unexpectedlyc�D�tt�\}}t|�}|j�D�cgc]}|j	���}}|D�cgc]}|s�|��	}}|d=t
j�}|D�cgc]}|s�|j	���}}|j
||�tjt�}tjj|�}|j||�|j||�|j||�ycc}wcc}wcc}w�N�)
rJrre�
splitlinesr7�html2text_of_expectedr�inspect�
getabsfile�urllib�parse�quote�assertIn)	ror��doc_loc�text_result�line�
text_lines�expected_lines�mod_file�mod_urls	         r$�
test_html_doczPydocDocTest.test_html_doc�s���)��3������'��/:�/E�/E�/G�H�/G�t�d�j�j�l�/G�
�H�'1�:�z�t�T�d�z�
�:��q�M�.�9�9�;��3A�J�>�4�T�$�*�*�,�>��J�����^�4��%�%�i�0���,�,�$�$�X�.���
�
�g�v�&��
�
�h��'��
�
�g�v�&��I��:��Ks�D�
D�D�6D�>Dc��tt�\}}t|ftzt	j
t�fzz}|j
||�yrs)rXr�expected_text_pattern�expected_text_data_docstringsr�r�r)ror�r��
expected_texts    r$�
test_text_doczPydocDocTest.test_text_doc�sQ��)��3����-� �
�5�6� �+�+�I�6�8�9�:�
�	
�����/r#c��ddl}Gd�d|j�}tj|�}|j	d|�y)Nrc��eZdZdZdZy)�IPydocDocTest.test_text_enum_member_with_value_zero.<locals>.BinaryIntegerrr�N)rrr �zero�oner"r#r$�
BinaryIntegerr��s���D��Cr#r�zBinaryInteger.zero)�enum�IntEnumr5�
render_docr�)ror�r�rGs    r$�%test_text_enum_member_with_value_zeroz2PydocDocTest.test_text_enum_member_with_value_zero�s8��	�	�D�L�L�	����}�-���
�
�*�C�0r#c�n�ttjj�}|j	d|�y)Nzxml.etree.elementtree)rV�xml�etree�ElementTreer�)ro�doc_links  r$�,test_mixed_case_module_names_are_lower_casedz9PydocDocTest.test_mixed_case_module_names_are_lower_cased�s%��!�#�)�)�"7�"7�8���
�
�-�x�8r#c�b�ttj�\}}|j|dd�y)Nr'z'MODULE DOCS incorrectly includes a link)rXr�r�r)ror�r�s   r$�test_issue8225zPydocDocTest.test_issue8225�s'��(����3��������"�&O�Pr#c��tj}	dt_tj�|t_y#|t_wxYwrs)rl�stdinr5�getpager)ro�previous_stdins  r$�test_getpager_with_stdin_nonez*PydocDocTest.test_getpager_with_stdin_none�s0������	'��C�I��N�N��&�C�I���C�I�s	�=�
A
c���Gd�d�}Gd�d�}tj|��}tj|��}|j|jdd�|�y)Nc��eZdZdZy)�)PydocDocTest.test_non_str_name.<locals>.A�*N�rrr r"r#r$�Ar��s���Hr#r�c��eZdZy)�)PydocDocTest.test_non_str_name.<locals>.BNr�r"r#r$�Br�����r#r�)r5r�rr1)ror�r��adoc�bdocs     r$�test_non_str_namezPydocDocTest.test_non_str_name�sU��	�	�	�	������$�������$��������c�3�/��6r#c�j�d}tt|�d�}t|z}|j||d�y)N�test.i_am_not_here�asciiz&documentation for missing module found)�strrA�missing_patternr�ro�missing_moduler��expecteds    r$�
test_not_herezPydocDocTest.test_not_here�s7��-���^�N�3�W�=��"�^�3������6�4�	6r#c��tdd��}tjjdd�}|j	||�y)Nz#test.test_pydoc.test_pydoc.nonasciir�)�PYTHONIOENCODING�backslashreplace)r?rr!�encoder�)ror��encodeds   r$�test_not_asciizPydocDocTest.test_not_ascii�s7���@�SZ�[���"�"�)�)�'�3E�F���
�
�g�v�&r#c��d}tt|�d�}t|j�z}|j	||�y)Nz test.i_am_not_here r�)r�rAr�r7rr�s    r$�test_input_stripzPydocDocTest.test_input_strip�s;��/���^�N�3�W�=��"�^�%9�%9�%;�;������6�*r#c���tj}|j|d�d�|j|d�d�|j|d�d�|j|d�d�y)Nz<function stripid at 0x88dcee4>z<function stripid>z <function stripid at 0x01F65390>�42z<type 'exceptions.Exception'>)r5�stripidr)ror�s  r$�test_stripidzPydocDocTest.test_stripid�sl���-�-������!B�C�-�	/�����!C�D�-�	/�	
�������-�����!@�A�8�	:r#c�~�tj�}|jt�}d}|j	||�y)a�Tests help on builtin object which have more than four child classes.

        When running help() on a builtin class which has child classes, it
        should contain a "Built-in subclasses" section and only 4 classes
        should be displayed with a hint on how many more subclasses are present.
        For example:

        >>> help(object)
        Help on class object in module builtins:

        class object
         |  The most base type
         |
         |  Built-in subclasses:
         |      async_generator
         |      BaseException
         |      builtin_function_or_method
         |      bytearray
         |      ... and 82 other subclasses
        z� |  Built-in subclasses:
 |      async_generator
 |      BaseException
 |      builtin_function_or_method
 |      bytearray
 |      ... and \d+ other subclassesN)r5rU�docclass�object�assertRegex�rorGr[�snips    r$�)test_builtin_with_more_than_four_childrenz6PydocDocTest.test_builtin_with_more_than_four_children	s6��*�m�m�o���|�|�F�#��8��	
����t�$r#c�~�tj�}|jt�}d}|j	||�y)a1Tests help on builtin object which have only child classes.

        When running help() on a builtin class which has child classes, it
        should contain a "Built-in subclasses" section. For example:

        >>> help(ArithmeticError)
        Help on class ArithmeticError in module builtins:

        class ArithmeticError(Exception)
         |  Base class for arithmetic errors.
         |
         ...
         |
         |  Built-in subclasses:
         |      FloatingPointError
         |      OverflowError
         |      ZeroDivisionError
        zc |  Built-in subclasses:
 |      FloatingPointError
 |      OverflowError
 |      ZeroDivisionErrorN)r5rUr��ArithmeticErrorr�r�s    r$�test_builtin_with_childz$PydocDocTest.test_builtin_with_child(s4��&�m�m�o���|�|�O�,��,��	
�
�
�d�D�!r#c��tj�}|jt�}d}|j	||�|jd|�y)a�Tests help on builtin classes which have grandchild classes.

        When running help() on a builtin class which has child classes, it
        should contain a "Built-in subclasses" section. However, if it also has
        grandchildren, these should not show up on the subclasses section.
        For example:

        >>> help(Exception)
        Help on class Exception in module builtins:

        class Exception(BaseException)
         |  Common base class for all non-exit exceptions.
         |
         ...
         |
         |  Built-in subclasses:
         |      ArithmeticError
         |      AssertionError
         |      AttributeError
         ...
        z^ |  Built-in subclasses:
 |      ArithmeticError
 |      AssertionError
 |      AttributeError�ZeroDivisionErrorN)r5rUr��	Exceptionr��assertNotInr�s    r$�test_builtin_with_grandchildz)PydocDocTest.test_builtin_with_grandchildCsE��,�m�m�o���|�|�I�&��)��	
�
�
�d�D�!����,�d�3r#c�z�tj�}|jt�}|j	d|�y)a�Tests help on builtin object which have no child classes.

        When running help() on a builtin class which has no child classes, it
        should not contain any "Built-in subclasses" section. For example:

        >>> help(ZeroDivisionError)

        Help on class ZeroDivisionError in module builtins:

        class ZeroDivisionError(ArithmeticError)
         |  Second argument to a division or modulo operation was zero.
         |
         |  Method resolution order:
         |      ZeroDivisionError
         |      ArithmeticError
         |      Exception
         |      BaseException
         |      object
         |
         |  Methods defined here:
         ...
        �Built-in subclassesN)r5rUr�r�r��rorGr[s   r$�test_builtin_no_childz"PydocDocTest.test_builtin_no_childcs/��.�m�m�o���|�|�-�.�����.��5r#c�z�tj�}|jt�}|j	d|�y)z�Tests help on metaclasses.

        When running help() on a metaclasses such as type, it
        should not contain any "Built-in subclasses" section.
        r�N)r5rUr��typer�r�s   r$�test_builtin_on_metaclassesz(PydocDocTest.test_builtin_on_metaclassess.���m�m�o���|�|�D�!�����.��5r#c�.�tdzj�}td�5}|jd�\}}|j	�j�dd}|djd�|d<|j
||�ddd�y#1swYyxYw)N�abdz-chelp()sabdi����i����rzhelp> )r�r�r�communicate�decode�removeprefixr)ro�elines�procr=r]�oliness      r$�test_fail_help_clizPydocDocTest.test_fail_help_cli�s���!�E�)�5�5�7��
�-�
(�D��%�%�f�-�F�C���Z�Z�\�,�,�.�r�"�5�F��q�	�.�.�x�8�F�1�I����V�V�,�	)�
(�
(�s�AB�Bc�:�t�5}tj|��}|jd�tdz}|j||j
�j�jdtj��ddd�y#1swYyxYw)N�rHr�r2)rr5�Helper�helpr�r�getvaluer7r1rQ�linesep)ro�buf�helperr�s    r$�test_fail_help_output_redirectz+PydocDocTest.test_fail_help_output_redirect�sg��
�Z�3��\�\��-�F��K�K���&��.�H����X�s�|�|�~�';�';�'=�'E�'E�d�B�J�J�'W�X�	�Z�Z�s�A=B�Bzpydoc.pagerc���d|_tt�\}}d}dj�}t	j
|�}|tz}td�5}td�5}t�5}	tj|	��}
|
j|�|	j�j�}||ftztj t�fzz}|j#d|j��|j#d|j��|j#||�ddd�ddd�ddd�|j%�y#1swY�*xYw#1swY�.xYw#1swY�2xYw)Nztest.test_pydoc.pydoc_modzO
        Help on module test.test_pydoc.pydoc_mod in test.test_pydoc:

        �stdout�stderrr�r')�maxDiffrXr�lstrip�textwrap�dedentr�rrr5r�r�rr7r�r�r�r�assert_not_called)
ro�
pager_mock�unusedr�rF�help_header�expected_help_patternrHr>rrr�r�s
             r$�test_help_output_redirectz&PydocDocTest.test_help_output_redirect�s9�����(��3����,���
�F�H�	��o�o�k�2�� +�.C� C��
�X�
&�&�
�X�
&�#�
�Z�3��\�\��-�F��K�K����\�\�^�)�)�+�F�1�$�J�9�:�$�/�/�	�:�<�=�>�M�
���R����!2�3����R�����0����]�F�3��'�'�	�$�$�&��Z��'�
&��'�
&�s=�E-�!E!�,CE�,E!�4E-�E�E!�!E*	�&E-�-E6c������fd�}d�_|dd�|dd�|dd�|dd	�|d
d�|dd�|d
d�|dd�|dd�|dd�|tjjd�y)Nc
�6��td�5}td�5}t�5}tj|��}|j	|�|j�j
�}�jd|j�d|�d����jd|j�d|�d����j||d|�d����j�ddd�ddd�ddd�y#1swY�xYw#1swY�xYw#1swYyxYw)	z7Helper function to run pydoc with its output redirectedrrr�r'zfailed on request "�")�msgN)
rrr5r�r�rr7rr�r)	�request�expected_text_partrHr>rrr�r
ros	       ��r$�run_pydoc_for_requestzVPydocDocTest.test_help_output_redirect_various_requests.<locals>.run_pydoc_for_request�s���� ��*�f� ��*�c���s����S�1�����G�$�����-�-�/��� � ��V�_�_�%6�>Q�RY�QZ�Z[�<\� �]�� � ��S�\�\�^�;N�w�i�WX�9Y� �Z��
�
�0�&�@S�T[�S\�\]�>^�
�_��,�,�.��+�+�*����+�*��+�*�s:�D�D�B:C7�D�&D�7D�<D�D	�D�D�keywordsz&Here is a list of the Python keywords.�symbolsz)Here is a list of the punctuation symbols�topicsz#Here is a list of available topics.�%zThe power operator�Truezclass bool(int)�False�Nonezclass NoneType(object)�assertzThe "assert" statement�TYPESzThe standard type hierarchyzpydoc.Helper.helpz&Help on function help in pydoc.Helper:z&Help on function help in module pydoc:)rr5r�r�)ror
rs`` r$�*test_help_output_redirect_various_requestsz7PydocDocTest.test_help_output_redirect_various_requests�s����	/����	�j�*R�S��i�)T�U��h�(M�N�	�c�#7�8��f�&7�8��g�'8�9��f�&>�?��h�(@�A��g�'D�E��1�3[�\��e�l�l�/�/�1Y�Zr#c���t�5}tj�}|jd�ddd�j	�}|jd|�y#1swY�,xYw)N�with�The "with" statement)rr5r��	showtopicrr�)ro�showtopic_ior�helptexts    r$�test_showtopiczPydocDocTest.test_showtopic�sP��
�
�,��\�\�^�F����V�$�� �(�(�*���
�
�,�h�7�	�
�s�&A�A%c���t�5}tj�}|jd�d}|j	||j�j
��ddd�y#1swYyxYw)Nr�� no documentation found for 'abd')rr5r�r&rrr7)ror'rr�s    r$�test_fail_showtopicz PydocDocTest.test_fail_showtopic�sV��
�
�,��\�\�^�F����U�#�9�H����X�|�'<�'<�'>�'D�'D�'F�G�	�
�
�s�AA*�*A3c��t�5}tj|��}|jd�d}|j	||j�j
��ddd�|j�y#1swY�xYw)Nr�r�r+)rr5r�r&rrr7r)ror
rrr�s     r$�#test_fail_showtopic_output_redirectz0PydocDocTest.test_fail_showtopic_output_redirect�sd��
�Z�3��\�\��-�F����U�#�9�H����X�s�|�|�~�';�';�'=�>�	�	�$�$�&�
�Z�s�AA<�<Bc��d|_td�5}td�5}t�5}tj|��}|jd�|j
�j�}|jd|j
��|jd|j
��|jd|�ddd�ddd�ddd�|j�y#1swY�*xYw#1swY�.xYw#1swY�2xYw)Nrrr�r$r'r%)rrrr5r�r&rr7rr�r)ror
rHr>rrr�s       r$�test_showtopic_output_redirectz+PydocDocTest.test_showtopic_output_redirects������
�X�
&�&�
�X�
&�#�
�Z�3��\�\��-�F����V�$��\�\�^�)�)�+�F����R����!2�3����R�����0��M�M�0�&�9�
�'�'�	�$�$�&��Z��'�
&��'�
&�s:�D�C7�BC+�C7�
D�+C4�0C7�7D	�<D�Dc���d�}dti|_td�5}tj|�ddd�j�}|j
d|�y#1swY�,xYw)Nc��yr�r"��a�b�cs   r$�<lambda>zAPydocDocTest.test_lambda_with_return_annotation.<locals>.<lambda>���qr#�returnrzlambda (a, b, c) -> int��int�__annotations__rr5r�rr��ro�func�help_ior(s    r$�"test_lambda_with_return_annotationz/PydocDocTest.test_lambda_with_return_annotationsT�� �� (�#����
�X�
&�'��J�J�t��'��#�#�%���
�
�/��:�'�
&�s�A�A&c���d�}tttd�|_td�5}tj|�ddd�j�}|j
d|�y#1swY�,xYw)Nc��yr�r"r3s   r$r7zDPydocDocTest.test_lambda_without_return_annotation.<locals>.<lambda>r8r#r3rzlambda (a: int, b: int, c: int)r:r=s    r$�%test_lambda_without_return_annotationz2PydocDocTest.test_lambda_without_return_annotationsW�� ��%(�s��=���
�X�
&�'��J�J�t��'��#�#�%���
�
�7��B�'�
&�s�A'�'A0c���d�}ttttd�|_td�5}tj|�ddd�j�}|j
d|�y#1swY�,xYw)Nc��yr�r"r3s   r$r7zLPydocDocTest.test_lambda_with_return_and_params_annotation.<locals>.<lambda>'r8r#)r4r5r6r9rz&lambda (a: int, b: int, c: int) -> intr:r=s    r$�-test_lambda_with_return_and_params_annotationz:PydocDocTest.test_lambda_with_return_and_params_annotation&sY�� ��%(�s���L���
�X�
&�'��J�J�t��'��#�#�%���
�
�>��I�'�
&�s�A,�,A5c�8�tdddg�}t�5}tj|�ddd�j	�}|jd|�|jd|�|jd|�|jd|�y#1swY�bxYw)N�Person�nickname�	firstnamezAlias for field number 0zAlias for field number 1�rrr5r�rr�)rorHr?r(s    r$�test_namedtuple_fieldsz#PydocDocTest.test_namedtuple_fields.s}���H�z�;�&?�@��
�
�'��J�J�v����#�#�%���
�
�j�(�+��
�
�k�8�,��
�
�0�(�;��
�
�0�(�;�
�
�s�B�Bc��tdddgd��}t�5}tj|�ddd�j	�}|jd|�|jd|�|jd|�y#1swY�PxYw)	N�NT�abc�defT)�rename�_1�_replace�_asdictrK)rorNr?r(s    r$�!test_namedtuple_public_underscorez.PydocDocTest.test_namedtuple_public_underscore8sm��
��u�e�n�T�
:��
�
�'��J�J�r�N���#�#�%���
�
�d�H�%��
�
�j�(�+��
�
�i��*��
�s�B�B	c�b�|jtt�dD]�}ttd|��5}|dk7rt	dj|�|��t	d|��t	d|��ddd�t
jti�}|j|d	���y#1swY�8xYw)
N)z
ISO-8859-1�UTF-8�w��encodingrWz#coding: {})�fileu"""line 1: héz
line 2: hi"""uline 1: hé)	�
addCleanuprr�open�print�formatr5�synopsisr)rorZ�scriptr`s    r$�
test_synopsiszPydocDocTest.test_synopsisAs��������'�/�H��f�c�H�5���w�&��-�.�.�x�8�v�F��(�v�6��o�F�3�	6�
�~�~�f�b�1�H����X��7�0�5�5�s�<B%�%B.	c���tjd�}|jj�d}|jj
}t
j|�}|j||�y)NrQr)	r�import_fresh_moduler!r��__spec__�cachedr5r`r)rorQr��filenamer`s     r$�test_synopsis_sourcelessz%PydocDocTest.test_synopsis_sourcelessLsV��
�
.�
.�t�
4���:�:�(�(�*�1�-���;�;�%�%���>�>�(�+������8�,r#c��tj�5}tjj	|d�}t
jj|�}t|d�5}|jd�ddd�tj|�tj|i�}|j|�tj|i�}|j|�ddd�y#1swY�uxYw#1swYyxYw)Nzfoomod42.pyrX�foo = 1)r	�temp_cwdrQrR�join�	importlib�util�cache_from_sourcer]�write�
py_compile�compiler5r`�assertIsNone)ro�test_dir�	init_path�cached_path�fobjr`�synopsis_cacheds       r$�"test_synopsis_sourceless_empty_docz/PydocDocTest.test_synopsis_sourceless_empty_docUs���
�
�
�
!�X������X�}�=�I�#�.�.�:�:�9�E�K��i��%���
�
�9�%�&����y�)��~�~�i��4�H����h�'�#�n�n�[�"�=�O����o�.�"�
!�&�%��"�
!�s%�AC3�!C'�3A+C3�'C0	�,C3�3C<c�R�d}|jtj|�d�y)Nz#I Am A Doc


Here is my description)z
I Am A Docz
Here is my description)rr5�splitdoc)ro�example_strings  r$�test_splitdoc_with_descriptionz+PydocDocTest.test_splitdoc_with_descriptionas$��A���������7�C�	Er#c��tj�5}|jtj|��ddd�y#1swYyxYwrs)r	rk�assertFalser5�	ispackage)rorts  r$� test_is_package_when_not_packagez-PydocDocTest.test_is_package_when_not_packagefs3��
�
�
�
!�X����U�_�_�X�6�7�"�
!�
!�s�%A�Ac�<�tj�5}tjj	|d�}t|d�j
�|jtj|��tj|�ddd�y#1swYyxYw)N�__init__.pyrX)r	rkrQrRrlr]�close�
assertTruer5r��remove)rortrus   r$�test_is_package_when_is_packagez,PydocDocTest.test_is_package_when_is_packagejsd��
�
�
�
!�X������X�}�=�I���C� �&�&�(��O�O�E�O�O�H�5�6��I�I�i� �	"�
!�
!�s�A4B�Bc��Gd�dt�}ttt��}|j|d<|d=|d=|j|d<|j
|d<t
j|�}|j||�y)Nc��eZdZd�Zy)�/PydocDocTest.test_allmethods.<locals>.TestClassc��y)NTr"rns r$�method_returning_truezEPydocDocTest.test_allmethods.<locals>.TestClass.method_returning_truexs��r#N)rrr r�r"r#r$�	TestClassr�ws��
r#r�r�r!�	__class__�__subclasshook__�__init_subclass__)	r��dict�varsr�r�r�r5�
allmethods�assertDictEqual)ror�r��methodss    r$�test_allmethodszPydocDocTest.test_allmethodsqs���	��	�
��V��%��,5�,K�,K��(�)��Y���[�!�(1�'A�'A��#�$�(1�(C�(C��$�%��"�"�9�-�����W�h�/r#c���Gd�d��G�fd�d��}tj|�}t|�}|j|dtz�tj|tj
���}dt�d�}t
|�}|jd	�D�cgc]}|s�|j���}}|D]}|j||��ycc}w)
Nc��eZdZdd�ZeZd�Zy)�+PydocDocTest.test_method_aliases.<locals>.ANc��y)z(Raise this widget in the stacking order.Nr")ro�	aboveThiss  r$�tkraisez3PydocDocTest.test_method_aliases.<locals>.A.tkraise���r#c��y)zReturn sizeNr"rns r$�a_sizez2PydocDocTest.test_method_aliases.<locals>.A.a_size�r�r#rs)rrr r��liftr�r"r#r$r�r��s��
?��D�
"r#r�c�4��eZdZdd�ZeZW�j
Zy)�+PydocDocTest.test_method_aliases.<locals>.BNc��y)z'Configure resources of an item TAGORID.Nr")ro�tagOrId�cnf�kws    r$�
itemconfigurez9PydocDocTest.test_method_aliases.<locals>.B.itemconfigure�r�r#rs)rrr r��
itemconfigr��b_size)r�s�r$r�r��s���
>�&�J��X�X�Fr#r�amPython 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
 |
 |  __weakref__
 |      list of weak references to the object
��rendererz1
Python Library Documentation

class B in module a�
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
        __weakref__
            list of weak references to the object
r2)
r5r�rNrrrCre�splitr7r�)	ror�rGr��as_textr�r��
expected_liner�s	        @r$�test_method_aliasesz PydocDocTest.test_method_aliases�s����	"�	"�	��	����q�!����o������%�J�K%�%	�N���q�5�=�=�?�;����*���
�:�C�.��3@�3F�3F�t�3L�U�3L�4�PT�$�*�*�,�3L��U�+�M��M�M�-��1�,��Vs�#C�+Cc�T�ddl}t|�\}}t|�\}}tt�\}}tt�\}}|jD]U}|�d�}d|�d�}	|j||�|j|	|�|j
||�|j
|	|��Wy)Nrz = _Featurez<strong>z</strong> = _Feature)�
__future__rXrJr�all_feature_namesr�r�)
ror��future_textr]�future_html�pydoc_mod_text�pydoc_mod_html�feature�txtrds
          r$�test__future__importsz"PydocDocTest.test__future__imports�s���	�'�
�3���Q�'�
�3���Q�*�9�5����*�9�5����!�3�3�G��I�[�)�C��g�Y�&:�;�D��M�M�#�{�+��M�M�$��,����S�.�1����T�>�2�
4r#)3rrr rrp�unittest�skipIf�hasattrrlr�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�mock�patchrr"r)r,r.r0r@rCrFrLrUrbrhryr}r�r�r�r�r�r"r#r$r�r��s����G�3��X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��
'��J�
'��X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��0��J�0�1�9�
Q�
'�
7�6��'��'�
+�:�%�>"�64�@6�8	6�-�Y��X�_�_�W�S�*�-�@�,�#�,�,�.�H�J�
�]�]����'��'��(�J�'�<�X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��
�]�]����'�'[�(��J�'[�T8�H��]�]����'�'�(�'��X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��
�]�]����'�'�(��J�'�";�C�J�<�+�	8��-��-�
/�E�
8�!�0�2�W2��W2�r3r#r�c��eZdZd�Zd�Zd�Zd�Zeje	jed�d���Zd�Z
e	jd�d	��Ze	jd�d
��Ze	jd�d��Zd
�Zy)�PydocImportTestc��tjt�|_|j	t
t�t
j�yrs)rQ�mkdirrrtr\rrm�invalidate_cachesrns r$�setUpzPydocImportTest.setUp�s,������(��
������'��#�#�%r#c��d}ddddj|�dfdj|�dj|�ff}tjjt|�tj
zdz}|D]w\}}t
|d	�5}|jd
j|��ddd�t|t��jd�}t||fz}|j||��yy#1swY�IxYw)
N�
testmod_xyzzy)�
i_am_not_herer�)�test.i_am_not_here_eitherr�)ztest.i_am_not_here.neither_am_ir�zi_am_not_here.{}r�ztest.{}�pyrXz
import {}
)�
PYTHONPATHr�)r_rQrRrlr�extsepr]rprAr��badimport_patternr)	ro�modname�	testpairs�sourcefn�importstring�
expectedinmsg�fr�r�s	         r$�test_badimportzPydocImportTest.test_badimport�s���"��.�F�E�
�
&�
&�w�
/��A�
�
�
�g�
&�	�(8�(8��(A�B��	��7�7�<�<���0�2�9�9�<�t�C��+4�'�L�-��h��$�����
�,�,�\�:�;�%�#�G��?�F�F�w�O�F�(�G�]�+C�C�H����X�v�.�,5�$�$�s�!C0�0C9	c��tjjtd�}tj|�tjj|d�tj
zdz}t
|d�5}|jd�ddd�|jtg��5t�5}t�5}tjd�ddd�ddd�|jj�d�|jj�d�t�5}t�5}tjd�ddd�ddd�|j|j�j�d�|j|j�d�ddd�y#1swY��/xYw#1swY��xYw#1swY��xYw#1swY��xYw#1swY��xYw#1swYyxYw)	N�	syntaxerr�__init__r�rXzinvalid python syntax = $1
�rR�xyzzyr')rQrRrlrr�r�r]rpr|rrr5�aproposrrr7)ro�pkgdir�	badsyntaxr�r=r>s      r$�test_apropos_with_bad_packagez-PydocImportTest.test_apropos_with_bad_packagesd�������f�k�2��
������G�G�L�L���4�r�y�y�@�4�G�	�
�)�S�
!�Q�
�G�G�2�3�"�
�
(�
(�v�h�
(�
7� �"�c�$�&�#��M�M�'�*�'�#�
���S�\�\�^�R�0����S�\�\�^�R�0� �"�c�$�&�#��M�M�+�.�'�#�
���S�\�\�^�1�1�3�[�A����S�\�\�^�R�0�8�
7�"�
!��'�&��#�"��'�&��#�"��8�
7�sz�:F9�+G6�6G�G�G�AG6�1G*�<G�G*�AG6�9G�G�G�G	�G6�G'�#G*�*G3	�/G6�6G?c�h�tjjtd�|_tj
|jd�|j
tj|j�|jtg��5t�5}t�5}tjd�ddd�ddd�ddd�|jj�d�|jj�d�y#1swY�ZxYw#1swY�^xYw#1swY�bxYw)N�
unreadablerr��SOMEKEYr')rQrRrlr�unreadable_dirr�r\�rmdirr|rrr5r�rr)ror=r>s   r$� test_apropos_with_unreadable_dirz0PydocImportTest.test_apropos_with_unreadable_dir's��� �g�g�l�l�6�<�@���
����$�$�a�(�������$�"5�"5�6��
(�
(�v�h�
(�
7� �"�c�$�&�#��M�M�)�,�'�#�8�
	
��������,���������,�	'�&��#�"��8�
7�s<�D(�D�!D�7D�?D(�D�D�D%	�!D(�(D1zcannot remove x bitc�^�tjjtd�}tj|�|jt|�tjj|d�}t|d�5}|jd�ddd�tjtj|�j�}	tj||tjz�|jtg��5t�5}t!j"d�ddd�ddd�|j%dj'��tj||�y#1swY��xYw#1swY�TxYw#1swY�XxYw#tj||�wxYw)N�walkpkgr�rXrjr�r')rQrRrlrr�r\rr]rp�stat�S_IMODE�st_mode�chmod�S_IEXECr|rr5r�r�r)ror�rurw�current_moders      r$�test_apropos_empty_docz&PydocImportTest.test_apropos_empty_doc6s�������f�i�0��
����������'��G�G�L�L���7�	�
�)�S�
!�T��J�J�y�!�"��|�|�B�G�G�F�O�$;�$;�<��	+��H�H�V�\�T�\�\�M�9�:��,�,�6�(�,�;�_�=N�RX��
�
�b�!�>O�;��M�M�)�V�_�_�%6�7��H�H�V�\�*�"�
!��
>O�=N��;�;��
�H�H�V�\�*�sH�<E0�	?F�F�E<�)F�1(F�0E9�<F	�F�F�
F�F,c���tjjtd�}tj|�tjj|d�}t|dd��5}|j
d�ddd�|jtg��5ttj�}tjjdt�	|jtd	�5ddl
}ddd�|jd
d�}d}|j||�|tjdd	ddd�y#1swY��xYw#1swY�XxYw#|tjddwxYw#1swYyxYw)
N�test_error_packager��wtr�rYzraise ValueError("ouch")
r�r�ouchzsearch?key=test_error_package�Pydoc: Search Resultsz8<a href="test_error_package.html">test_error_package</a>)rQrRrlrr�r]rpr|�tuplerl�insert�assertRaisesRegex�
ValueErrorr�r�r�)ror��initr��saved_pathsr�r[�founds        r$�test_url_search_package_errorz-PydocImportTest.test_url_search_package_errorHs�������f�&:�;��
������w�w�|�|�F�M�2��
�$��w�
/�1�
�G�G�4�5�0�
�
(�
(�v�h�
(�
7�����/�K��H�H�O�O�A�v�&�

*��+�+�J��?�-�@��,�,�-L�+�-��-���
�
�e�T�*�)������8�
7�0�
/��@�?��*�������8�
7�sH�(D>�>E.�E�.E
�3.E�!E.�>E�
E	�E�E+�+E.�.E7z(causes undesirable side-effects (#20128)c��d}d}d}||z|z}t�}tj|��}|d�|j�j	�}t|j
��}|j||�y)N���r�rm)rr5r�rr7�lenr��assertGreaterEqual)	ro�num_header_lines�num_module_lines_min�num_footer_linesr�rHrr��	num_liness	         r$�test_moduleszPydocImportTest.test_modules_s|���� ����#�&:�:�=M�M��������V�,���y�����"�(�(�*����)�)�+�,�	����	�8�4r#c���d}t�}tj|��}t�5}|d�ddd�j	�}|j||�y#1swY�,xYw)Nzpydoc - r�z
modules pydoc)rr5r�rrr��ror�rHrr?r�s      r$�test_modules_searchz#PydocImportTest.test_modules_searchosX����������V�,��
�
�'��?�#���!�!�#���
�
�h��'�	�
�s�	A!�!A*z+some buildbots are not cooperating (#20128)c��d}t�}tj|��}t�5}|d�ddd�j	�}|j|j
|��y#1swY�:xYw)Nzgc - r�zmodules garbage)rr5r�rrr��
startswithrs      r$�test_modules_search_builtinz+PydocImportTest.test_modules_search_builtin|s`����������V�,��
�
�'��$�%���!�!�#������)�)�(�3�4�	�
�s�	A/�/A8c��	tjtj�}|j|t�|j	|j
d�|j	|jtj�|j	|jtj�ttjd<y#ttjd<wxYwri)	r5�
importfiler6�assertIsNotrrrerlrm)ro�loaded_pydocs  r$�test_importfilezPydocImportTest.test_importfile�s���	)� �+�+�E�N�N�;�L����\�5�1����\�2�2�G�<����\�2�2�E�N�N�C����\�2�2�E�N�N�C�#(�C�K�K�� ��5�C�K�K�� �s�B)C�CN)rrr r�r�r�r�r	�skip_unless_working_chmodr�r�rr�r��skiprrr	rr"r#r$r�r��s���&�
/�*1�*
-��(�(��X�_�_�]�$9�:�+�;�)�+� *�.�X�]�]�=�>�
5�?�
5��X�]�]�=�>�
(�?�
(��X�]�]�@�A�	5�B�	5�	)r#r�c�v�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
ed	��Zed
��Z
d�Zed��Zd
�Zd�Zed��Zed��Zd�Zd�Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Z ed��Z!d�Z"d�Z#ed ��Z$y!)"�TestDescriptionsc�R�|jtjdt�yrirjrns r$rpzTestDescriptions.tearDown�r�r#c�Z�tjt�}|jd|�y)Nr)r5r�rr��rorGs  r$�test_modulezTestDescriptions.test_module�s �����{�+���
�
�m�S�)r#c��Gd�d�}|�}|jtj|�d�|jtj|�d�dtz}|j	|tj
|��y)Nc��eZdZdZy)�&TestDescriptions.test_class.<locals>.CzNew-style classNrr"r#r$�Cr�s��"r#rzclass CzC in module %s object)rr5�describerr�r�)rorr6r�s    r$�
test_classzTestDescriptions.test_class�sd��"�"�
�C���������*�I�6��������*�C�0�*�X�5���
�
�h�� 0� 0�� 3�4r#c�R�|jtjtjt
�d�tjtjt
tj��}|jd|�|jd|�ts?|jtjj�j�d|�|jtjtt
�d�tjtt
tj��}|jd|�|jd|�ts@|jtjj�j�d|�yy)	N�
_GenericAliasr�z_GenericAlias in module typingzList = class list(object)r�GenericAliaszGenericAlias in module builtinsz
class list(object))rr5r�typing�Listr;r��	plaintextr�r�listr!r7r�rs  r$�test_generic_aliasz#TestDescriptions.test_generic_alias�s�����������C�(8�9�?�K����v�{�{�3�/�%�/�/�J���
�
�6��<��
�
�1�3�7�#��M�M�$�,�,�,�,�.�9�9�;�A�>��D��������S�	�2�N�C����t�C�y�5�?�?�C���
�
�7��=��
�
�,�c�2�#��M�M�$�,�,�,�,�.�9�9�;�A�>��D�$r#c��|jtjtjt
tf�d�tjtjt
tftj��}|jd|�|jd|�tjjrI|jtjjj�j�d|�|jtjt
tz�d�tjt
tztj��}|jd|�|jd|�tsJ|jtjjj�j�d|�yy)	N�_UnionGenericAliasr�z#_UnionGenericAlias in module typingzUnion = typing.Unionr�	UnionTypez UnionType in module types objectz!
class UnionType(builtins.object))rr5rr �Unionr;r�r�r"r�r!r7r�r�typesr'rs  r$�test_union_typez TestDescriptions.test_union_type�s2�����������S�#�X�(>�?�AU�V����v�|�|�C��H�5����P���
�
�;�S�A��
�
�,�c�2��<�<����M�M�&�,�,�.�.�4�4�6�A�A�C�A�F��L��������c�	�2�K�@����s�S�y�5�?�?�C���
�
�8�#�>��
�
�:�C�@�#��M�M�%�/�/�1�1�7�7�9�D�D�F�q�I�3�O�$r#c��|jtjtj�d�tj
tjtj��}|jd|�tjjr\|jd|�|jtjjj�j�d|�y|jd|�y)N�_SpecialFormr�z_SpecialForm in module typingzNoReturn = typing.NoReturnrz%NoReturn = class _SpecialForm(_Final))rr5rr �NoReturnr�r"r�r!r7r�rs  r$�test_special_formz"TestDescriptions.test_special_form�s������������8�.�I����v������I���
�
�5�s�;��?�?�"�"��M�M�6��<��M�M�&�/�/�1�1�7�7�9�D�D�F�q�I�3�O��M�M�A�3�Gr#c	�<�dtjtjdtdtjtj
ttjffd�}tjd�}Gd�dtj|tjttf�}|jtj|�j�dd	�|jtj|�j�d
d�y)N�data�xr9c��yrsr")r0r1s  r$�fooz/TestDescriptions.test_typing_pydoc.<locals>.foo�s��r#�Tc��eZdZy)�-TestDescriptions.test_typing_pydoc.<locals>.CNr�r"r#r$rr6�s�r#r���z?ffoooo(data: List[Any], x: int) -> Iterator[Tuple[int, Any]]r�z2class CC(collections.abc.Mapping, typing.Generic))r r!�Anyr;�Iterator�Tuple�TypeVar�Generic�Mappingr�rr5r�r�)ror3r4rs    r$�test_typing_pydocz"TestDescriptions.test_typing_pydoc�s���	�f�k�k�&�*�*�-�	��	�!�?�?�6�<�<��V�Z�Z��+H�I�	�
�N�N�3���A����q�!�6�>�>�#�s�(�#;�A�����)�)�#�.�9�9�;�B�?�9�	:�	
����)�)�!�,�7�7�9�!�<�P�	Rr#c��dD]<}|jtj|��	tj|��>dD]K}|jtj|��|jttj|��My#t$r#|jdj
|��Y��wxYw)N)r�z
str.translatezbuiltins.strzbuiltins.str.translatezfinding the doc of {!r} failed)�notbuiltins�strrrzstrr.translatezstr.trrrranslatezbuiltins.strrrzbuiltins.str.trrranslate)	�assertIsNotNoner5�locater��ImportError�failr_rs�assertRaises)ro�names  r$�test_builtinzTestDescriptions.test_builtin�s���/�D�
� � ����d�!3�4�
I�� � ��&�
/�1�D�
���e�l�l�4�0�1����k�5�+;�+;�T�B�	1���
I��	�	�:�A�A�$�G�H�
I�s�B�)B?�>B?c�~�tjtj|��}|jd�}|dS�Nr2r�)r5�plainr�r���or[�liness   r$�_get_summary_linez"TestDescriptions._get_summary_line�s2���{�{�5�+�+�A�.�/���
�
�4� ���Q�x�r#c��tjtj|��}|jd�}dj	|dd�SrJ)r5rKr�r�rlrLs   r$�_get_summary_linesz#TestDescriptions._get_summary_lines�s>���{�{�5�+�+�A�.�/���
�
�4� ���y�y��q�r��#�#r#c�v�|j|jtjj�d�y)Nzwrap(self, text))rrOr
�TextWrapper�wraprns r$�test_unbound_python_methodz+TestDescriptions.test_unbound_python_method�s,������/�/��0D�0D�0I�0I�J��	 r#c�v�|j|jtjj�d�y)Nz1dump(self, obj, /) unbound _pickle.Pickler method)rrO�_pickle�Pickler�dumprns r$�test_unbound_builtin_methodz,TestDescriptions.test_unbound_builtin_method�s+������/�/����0D�0D�E�?�	Ar#c��tj�}|j|j|j�d�y)Nz2wrap(text) method of textwrap.TextWrapper instance)r
rSrrOrT)ro�ts  r$�test_bound_python_methodz)TestDescriptions.test_bound_python_methods3��� � �"������/�/����7�@�	Br#c��tdgd��}tj|�}|j|j	d�|j	d��|j|j	d�|j	d��Gd�d�}Gd�d	�}tj|�tj|�y)
NrH)rIrJ�agegrouprIrJr_c��eZdZdZy)�MTestDescriptions.test_field_order_for_named_tuples.<locals>.NonIterableFieldsN�rrr �_fieldsr"r#r$�NonIterableFieldsra
s���Gr#rdc��eZdZggZy)�MTestDescriptions.test_field_order_for_named_tuples.<locals>.NonHashableFieldsNrbr"r#r$�NonHashableFieldsrfs	���d�Gr#rg)rr5r��
assertLess�index)rorHr+rdrgs     r$�!test_field_order_for_named_tuplesz2TestDescriptions.test_field_order_for_named_tupless����H�&K�L�����V�$��������
�+�Q�W�W�[�-A�B��������,�a�g�g�j�.A�B�	�	�	�	�	���*�+�
���*�+r#c��t�}tj|�}|j|j	|j
�d�y)Nz/dump(obj, /) method of _pickle.Pickler instance)rrWrXrrOrY)ror+�ps   r$�test_bound_builtin_methodz*TestDescriptions.test_bound_builtin_methods9���J���O�O�A�������/�/����7�=�	?r#c�b�|j|jtj�d�y)Nz0stat(path, *, dir_fd=None, follow_symlinks=True))rrOrQr�rns r$�test_module_level_callablez+TestDescriptions.test_module_level_callables%������/�/����8�>�	@r#c�b�|j|jtj�d�y)Nz*lower(self, /) unbound builtins.str method)rrOr��lowerrns r$�"test_unbound_builtin_method_noargsz3TestDescriptions.test_unbound_builtin_method_noargs$s$������/�/��	�	�:�8�	:r#c�Z�|j|jdj�d�y)Nr'z'lower() method of builtins.str instance)rrOrqrns r$� test_bound_builtin_method_noargsz1TestDescriptions.test_bound_builtin_method_noargs(s$������/�/����9�5�	7r#c�:�Gd�d�}|j|j|jd�d�|j|j|j�d�|j	dtjtj|���y)Nc��eZdZed��Zy)�-TestDescriptions.test_staticmethod.<locals>.Xc��y)zA static methodNr"�r1�ys  r$�smz0TestDescriptions.test_staticmethod.<locals>.X.sm/���r#N)rrr �staticmethodr{r"r#r$�Xrw.s��
�
��
r#r~r{zsm(x, y)
    A static method
zJ
 |  Static methods defined here:
 |
 |  sm(x, y)
 |      A static method
)rrQ�__dict__r{r�r5rKr��ror~s  r$�test_staticmethodz"TestDescriptions.test_staticmethod,s���	�	�
	
����0�0����D�1A�B�1�	2�	
����0�0����6�9�	�	
�
�
��
�[�[��!�!�!�$�%�	'r#c�:�Gd�d�}|j|j|jd�d�|j|j|j�d�|j	dtjtj|���y)Nc��eZdZed��Zy)�,TestDescriptions.test_classmethod.<locals>.Xc��y)zA class methodNr")�clsr1s  r$�cmz/TestDescriptions.test_classmethod.<locals>.X.cmDr|r#N)rrr �classmethodr�r"r#r$r~r�Cs��
�
��
r#r~r�zcm(...)
    A class method
zFcm(x) class method of test.test_pydoc.test_pydoc.X
    A class method
zE
 |  Class methods defined here:
 |
 |  cm(x)
 |      A class method
)rrQrr�r�r5rKr�r�s  r$�test_classmethodz!TestDescriptions.test_classmethodAs���	�	�
	
����0�0����D�1A�B�0�	1�	
����0�0����6�9�	�	
�
�
��
�[�[��!�!�!�$�%�	'r#c�|�|j|jtj�d�|j|jtj
�d�|j|jtj�d�|j|jtj�d�y)N�	numerator�realr:�obj)
rrOr;r��floatr�r�r:�
memoryviewr�rns r$�test_getset_descriptorz'TestDescriptions.test_getset_descriptorVs���	
����/�/��
�
�>��L�����/�/��
�
�;�V�D�����/�/�	���?��H�����/�/�
���?��Gr#c���|j|jtj�d�|j|jtj
�d�|j|jtj
�d�|j|jtj�d�|j|jtj�d�y)Nr��start�fget�value)rrO�complexr��ranger��slice�propertyr��
StopIterationr�rns r$�test_member_descriptorz'TestDescriptions.test_member_descriptor_s���	
����/�/����=�v�F�����/�/����<�g�F�����/�/����<�g�F�����/�/��
�
�>��G�����/�/�
�0C�0C�D�g�Nr#c�n�Gd�d�}|j|j|j�d�y)Nc��eZdZdZy)�4TestDescriptions.test_slot_descriptor.<locals>.PointryN)rrr �	__slots__r"r#r$�Pointr�ks�� �Ir#r�r1)rrOr1)ror�s  r$�test_slot_descriptorz%TestDescriptions.test_slot_descriptoris+��	!�	!�����/�/����8�#�>r#c�t�Gd�d�}|j|j|jd�d�y)Nc��eZdZy)�6TestDescriptions.test_dict_attr_descriptor.<locals>.NSNr�r"r#r$�NSr�qr�r#r�r)rrOr)ror�s  r$�test_dict_attr_descriptorz*TestDescriptions.test_dict_attr_descriptoros3��	�	�����/�/����J�0G�H�#�	%r#c��|j|jttj�j
�d�|j|jttj�j�d�|j|jttj�j�d�|j|jttj�j�d�y)N�width�debug�major�max)rrOr�rl�	hash_infor��flagsr��version_infor��
float_infor�rns r$� test_structseq_member_descriptorz1TestDescriptions.test_structseq_member_descriptorvs�������/�/��S�]�]�0C�0I�0I�J� �	"�����/�/��S�Y�Y��0E�0E�F� �	"�����/�/��S�5E�5E�0F�0L�0L�M� �	"�����/�/��S�^�^�0D�0H�0H�I��	 r#c�r�tdd�}|j|j|j�d�y)N�Box)r��heightz    Alias for field number 0
)rrrQr�)ror�s  r$� test_namedtuple_field_descriptorz1TestDescriptions.test_namedtuple_field_descriptor�s3���� 3�4������0�0����;�>�	r#c���Gd�d�}|j|j|j�d�|jdt	j
t	j|���y)Nc��eZdZed��Zy)�,TestDescriptions.test_property.<locals>.Rectc�4�|j|jzS)zArea of the rect)rX�hrns r$�areaz1TestDescriptions.test_property.<locals>.Rect.area�s���v�v�����&r#N)rrr r�r�r"r#r$�Rectr��s��
�
'��
'r#r�z    Area of the rect
z#
 |  area
 |      Area of the rect
)rrQr�r�r5rKr�)ror�s  r$�
test_propertyzTestDescriptions.test_property�s^��	'�	'�	
����0�0����;�>�	�	
�
�
���[�[��!�!�$�'�(�	*r#c���Gd�d��G�fd�d�}|j|j|j�dt�d��d|j_|j|j|j�dt�d��d	|j_|j|j|j�d
�y)Nc��eZdZd�Zy)�?TestDescriptions.test_custom_non_data_descriptor.<locals>.Descrc��|�|Sy�Nr�r"�ror�r�s   r$�__get__zGTestDescriptions.test_custom_non_data_descriptor.<locals>.Descr.__get__�����;��K�r#N)rrr r�r"r#r$�Descrr��s��
r#r�c���eZdZW��Zy)�;TestDescriptions.test_custom_non_data_descriptor.<locals>.XN�rrr �attr�r�s�r$r~r���
����7�Dr#r~rczH.TestDescriptions.test_custom_non_data_descriptor.<locals>.Descr object>�Custom descriptorz_.TestDescriptions.test_custom_non_data_descriptor.<locals>.Descr object>
    Custom descriptor
r3zfoo(...)
    Custom descriptor
)rrQr�rr!�ror~r�s  @r$�test_custom_non_data_descriptorz0TestDescriptions.test_custom_non_data_descriptor�s����	�	�
	�	�	
����0�0����8�?�
��S�;W�	X�-���������0�0����8�?�
���;�	�
 ���������0�0����8�;�	r#c�x��Gd�d��G�fd�d�}|j|j|j�d�d|j_|j|j|j�d�d|j_|j|j|j�d	�y)
Nc��eZdZd�Zd�Zy)�;TestDescriptions.test_custom_data_descriptor.<locals>.Descrc��|�|Syr�r"r�s   r$r�zCTestDescriptions.test_custom_data_descriptor.<locals>.Descr.__get__�r�r#c��ddzy)Nr�rr"r�s   r$�__set__zCTestDescriptions.test_custom_data_descriptor.<locals>.Descr.__set__�s	���!�r#N)rrr r�r�r"r#r$r�r��s��
�
r#r�c���eZdZW��Zy)�7TestDescriptions.test_custom_data_descriptor.<locals>.XNr�r�s�r$r~r��r�r#r~r'r�z    Custom descriptor
r3zfoo
    Custom descriptor
)rrQr�r!rr�s  @r$�test_custom_data_descriptorz,TestDescriptions.test_custom_data_descriptor�s����	�	�	�	�	
����0�0����8�"�=�,���������0�0����8�;�	� ���������0�0����8�;�	r#c�
�dtfd�}tjtjj	|��}|jd|�tj�j	|�}|jd|�y)Nr9c��K�y�wr�r")�igns r$�
coro_functionz=TestDescriptions.test_async_annotation.<locals>.coro_function�s	�����s�zasync coro_functionz4async <a name="-coro_function"><strong>coro_function)r;r5rKr"�documentr�rC)ror�r[rds    r$�test_async_annotationz&TestDescriptions.test_async_annotation�sd��	��	��{�{�5�?�?�3�3�M�B�C���
�
�+�T�2��}�}��'�'�
�6���
�
�B��	r#c��d�}tjtjj|��}|j	d|�tj
�j|�}|j	d|�y)Nc�K�d���y�wr�r"r"r#r$�an_async_generatorzLTestDescriptions.test_async_generator_annotation.<locals>.an_async_generator�s�����G�s�	zasync an_async_generatorz>async <a name="-an_async_generator"><strong>an_async_generator)r5rKr"r�r�rC)ror�r[rds    r$�test_async_generator_annotationz0TestDescriptions.test_async_generator_annotation�s_��	��{�{�5�?�?�3�3�4F�G�H���
�
�0�$�7��}�}��'�'�(:�;���
�
�L��	r#c�t�d�}tj�j|�}|jd|�y)Nc��y)za link https://localhost/Nr"r"r#r$�a_fn_with_https_linkzHTestDescriptions.test_html_for_https_links.<locals>.a_fn_with_https_link�s��r#z3<a href="https://localhost/">https://localhost/</a>)r5rCr�r�)ror�rds   r$�test_html_for_https_linksz*TestDescriptions.test_html_for_https_links�s2��	��}�}��'�'�(<�=���
�
�A��	
r#N)%rrr rprrr$r*r.r>rHr}rOrQrUrrZr]rjrmrorrrtr�r�r�r�r�r�r�r�r�r�r�r�r�r�r"r#r$rr�s���3�*�
5�
E�
P�H�
R�C�"�����$��$� ��A��A�
B�,� �?��?��@��@�:�7��'��'�(�'��'�(�H��H��O��O��?��?�
�%��%�� �� ������
*��
*�����0����0
�
��	
��	
r#rc�l�eZdZd�Zd�Zejfd�Zejfd�Zd�Z	d�Z
d�Zd�Zy	)
�PydocFodderTestc�R�|jtjdt�yrirjrns r$rpzPydocFodderTest.tearDown�r�r#c��|j�}d\}}|�|j|�}|�|j||�}|||S)N)rN)r�ri)ror[�	beginline�endlinerN�
beginindex�endindexs       r$�
getsectionzPydocFodderTest.getsection�sO�����!��&��
�H�� ����Y�/�J����{�{�7�J�7�H��Z��)�)r#c��tj�}|j|�}t|�}|tj
urdnd}|j
|d|�d�d�}|jd|�|jd|�|jd|�|jd	|�|jd
|�|jd|�|jd|�|jd
|�|jd|�|j
|d|�d�d�}|jd|�|tj
urdnd}|jd|z|�|jd|�|jd|�|jd|�|j
|d|�d�d�}|jd|�|jd|�y)N�defined here�inherited from Bz |  Methods �:zJ |  ----------------------------------------------------------------------z# |  A_method_alias = A_method(self)z# |  B_method_alias = B_method(self)z; |  A_staticmethod(x, y) from test.test_pydoc.pydocfodder.Az/ |  A_staticmethod_alias = A_staticmethod(x, y)z6 |  global_func(x, y) from test.test_pydoc.pydocfodderz) |  global_func_alias = global_func(x, y)zL |  global_func2_alias = global_func2(x, y) from test.test_pydoc.pydocfodderz* |  __repr__(self, /) from builtins.objectz# |  object_repr = __repr__(self, /)z |  Static methods zV |  A_classmethod_ref = A_classmethod(x) class method of test.test_pydoc.pydocfodder.Ar'�. class method of test.test_pydoc.pydocfodder.Bz( |  B_classmethod_ref = B_classmethod(x)zN |  A_method_ref = A_method() method of test.test_pydoc.pydocfodder.A instancez> |  get(key, default=None, /) method of builtins.dict instancezI |  dict_get = get(key, default=None, /) method of builtins.dict instancez |  Class methods z |  B_classmethod(x)z* |  B_classmethod_alias = B_classmethod(x))r5rUr�rNrr�r�r��ror�rGr��whererN�notes       r$�test_text_doc_routines_in_classz/PydocFodderTest.test_text_doc_routines_in_class�s����m�m�o�����c�"���F�#��"%����"6��<N������,�u�g�Q�(?��Q���
�
�;�U�C��
�
�;�U�C��
�
�S�UZ�[��
�
�G��O��
�
�N�PU�V��
�
�A�5�I��
�
�d�fk�l��
�
�B�E�J��
�
�;�U�C�����*=�e�W�A�(F��X���
�
�n�pu�v��K�M�M�)�r�/_���
�
�@�4�G��O��
�
�f�hm�n��
�
�V�X]�^��
�
�a�ch�i�����*<�U�G�1�(E��W���
�
�,�e�4��
�
�B�E�Jr#c�D�tj�}|j|�}t|�}|tj
urdnd}|j
|d|�d�d�}|jd|�|jd|�|jd|�|jd	|�|jd
|�|jd|�|jd|�|jd
|�|jd|�|j
|d|�d�d�}|jd|�|tj
urdnd}|jd|z|�|jd|�|j
|d|�d�d�}|jd|�|jd|�y)Nr�r�zMethods r�razA_method_alias = A_method(self)zB_method_alias = B_method(self)z7A_staticmethod(x, y) from test.test_pydoc.pydocfodder.Az+A_staticmethod_alias = A_staticmethod(x, y)z2global_func(x, y) from test.test_pydoc.pydocfodderz%global_func_alias = global_func(x, y)zHglobal_func2_alias = global_func2(x, y) from test.test_pydoc.pydocfodderz&__repr__(self, /) from builtins.objectzobject_repr = __repr__(self, /)zStatic methods zRA_classmethod_ref = A_classmethod(x) class method of test.test_pydoc.pydocfodder.Ar'r�z$B_classmethod_ref = B_classmethod(x)zJA_method_ref = A_method() method of test.test_pydoc.pydocfodder.A instancezClass methods zB_classmethod(x)z&B_classmethod_alias = B_classmethod(x))r5rCr�rerr�r�r�r�s       r$�test_html_doc_routines_in_classz/PydocFodderTest.test_html_doc_routines_in_classsw���m�m�o�����c�"���6�"��"%����"6��<N������(�5�'��(;�V�D���
�
�7��?��
�
�7��?��
�
�O�QV�W��
�
�C�U�K��
�
�J�E�R��
�
�=�u�E��
�
�`�bg�h��
�
�>��F��
�
�7��?�����/�%���(B�F�K���
�
�j�lq�r��K�M�M�)�r�/_���
�
�<�t�C�U�K��
�
�b�di�j�����.���q�(A�6�J���
�
�(�%�0��
�
�>��Fr#c�B�|jtj�yrs)r�r�Drns r$�)test_text_doc_inherited_routines_in_classz9PydocFodderTest.test_text_doc_inherited_routines_in_class2����,�,�[�]�]�;r#c�B�|jtj�yrs)r�rr�rns r$�)test_html_doc_inherited_routines_in_classz9PydocFodderTest.test_html_doc_inherited_routines_in_class5r�r#c��tj�}|jt�}t	|�}|j|dd�}|j
d|�|j
d|�|j
d|�|j
d|�|j
d|�|j
d|�|j
d	|�|j
d
|�|j
d|�|j
d|�|j
d
|�|j
d|�|j
d|�|j
d|�|j
d|�y)N�	FUNCTIONS�FILEz)    global_func_alias = global_func(x, y)z    A_staticmethod(x, y)z/    A_staticmethod_alias = A_staticmethod(x, y)z&    A_classmethod(x) class method of Az7    A_classmethod2 = A_classmethod(x) class method of Az7    A_classmethod3 = A_classmethod(x) class method of Bz#    A_method() method of A instancez/    A_method2 = A_method() method of A instancez/    A_method3 = A_method() method of B instancez-    A_staticmethod_ref = A_staticmethod(x, y)z@    A_staticmethod_ref2 = A_staticmethod(y) method of B instancez>    get(key, default=None, /) method of builtins.dict instancezI    dict_get = get(key, default=None, /) method of builtins.dict instancez    B_method(self)z    B_method2 = B_method(self))r5rUrDrrNr�r��rorGr�rNs    r$� test_text_doc_routines_in_modulez0PydocFodderTest.test_text_doc_routines_in_module8s���m�m�o�����{�+���F�#�������V�<���
�
�A�5�I��
�
�0�%�8��
�
�G��O��
�
�>��F��
�
�O�QV�W��
�
�O�QV�W��
�
�;�U�C��
�
�G��O��
�
�G��O��
�
�E�u�M��
�
�X�Z_�`��
�
�V�X]�^��
�
�a�ch�i��
�
�*�E�2��
�
�6��>r#c��tj�}|jt�}t	|�}|j|dd�}|j
d|�|j
d|�|j
d|�|j
d|�|j
d|�|j
d|�|j
d|�|j
d	|�|j
d
|�|j
d|�|j
d|�|j
d
|�|j
d|�|j
d|�|j
d|�y)Nz
 Functionsz& global_func_alias = global_func(x, y)z A_staticmethod(x, y)z, A_staticmethod_alias = A_staticmethod(x, y)z"A_classmethod(x) class method of Az4 A_classmethod2 = A_classmethod(x) class method of Az4 A_classmethod3 = A_classmethod(x) class method of Bz  A_method() method of A instancez, A_method2 = A_method() method of A instancez, A_method3 = A_method() method of B instancez* A_staticmethod_ref = A_staticmethod(x, y)z= A_staticmethod_ref2 = A_staticmethod(y) method of B instancez; get(key, default=None, /) method of builtins.dict instancezF dict_get = get(key, default=None, /) method of builtins.dict instancez B_method(self)z B_method2 = B_method(self))r5rCrDrrer�r�rs    r$� test_html_doc_routines_in_modulez0PydocFodderTest.test_html_doc_routines_in_moduleQs���m�m�o�����{�+���6�"�������d�;���
�
�>��F��
�
�-�u�5��
�
�D�e�L��
�
�:�E�B��
�
�L�e�T��
�
�L�e�T��
�
�8�%�@��
�
�D�e�L��
�
�D�e�L��
�
�B�E�J��
�
�U�W\�]��
�
�S�UZ�[��
�
�^�`e�f��
�
�'��/��
�
�3�U�;r#N)
rrr rpr�rr�r�r�r�r�rrr"r#r$r�r��s>��3�*�3>�-�-�K�83>�-�-�G�4<�<�?�2<r#r�z/Socket server not available on Emscripten/WASI.c��eZdZdZd�Zd�Zy)�PydocServerTestzTests for pydoc._start_serverc�R�|jtjdt�yrirjrns r$rpzPydocServerTest.tearDownqr�r#c	�:��d�}tj|dd���|j�jd�|j	�j
�|j
�fd��|jd�j�|j
t�|jdttjj�jd��j��|jdttjj�jd	��j���j�|j!�j
�|j#�j$�|j#�j�y)
Nc��d|�d|�d�}|S)Nzthe URL sent was: (z, �)r")r��content_typer[s   r$�my_url_handlerz3PydocServerTest.test_server.<locals>.my_url_handlerws��36��E�D��Kr#�	localhostr)�hostname�portc�@���jr�j�SdSrs)�serving�stop)�serverthreads�r$r7z-PydocServerTest.test_server.<locals>.<lambda>�s���<�+?�+?�L�%�%�'�I�T�Ir#s$the URL sent was: (/test, text/html)z/tests'the URL sent was: (/test.css, text/css)z	/test.css)r5�
_start_serverr�errorr�rr\r�r�rrr�r��urljoin�readrrrs�	docserver)ror
rs  @r$�test_serverzPydocServerTest.test_serverts<���	��*�*�� ����
	
����+�+�T�2�����,�,�-����I�	�	
�
�
�k�<�#3�#3�4����
�#����3��F�L�L�(�(��)9�)9�7�C�D�I�I�K�	�	
���6��F�L�L�(�(��)9�)9�;�G�H�M�M�O�	�
	��������-�-�.����,�0�0�1����,�*�*�+r#N)rrr r!rprr"r#r$rrks��
(�3� ,r#rc��eZdZdZd�Zd�Zy)�PydocUrlHandlerTestzTests for pydoc._url_handlerc��tj}|jt|dd�|jt|dd�y)Nr�r'r��foobar)r5r~rF�	TypeError)ror�s  r$�test_content_type_errz)PydocUrlHandlerTest.test_content_type_err�s5���������)�Q��R�0����)�Q��X�6r#c�F�gd�}|jtjdt�	|j	�5|D]\}}|j||��	ddd�ttjd<y#1swY�!xYw#ttjd<wxYw)N))r'�Pydoc: Index of Modules)zget?key=r")rir")rz
Pydoc: Topics)rzPydoc: Keywords)r5�Pydoc: module pydoc)z
get?key=pydocr#)zsearch?key=pydocr�)z
topic?key=defzPydoc: KEYWORD def)ztopic?key=STRINGSzPydoc: TOPIC STRINGS)rzPydoc: Error - foobarr5)rkrlrmr5r|r�)ro�requestsr�r^s    r$�test_url_requestsz%PydocUrlHandlerTest.test_url_requests�s�����	
�
�
�c�k�k�'�*�E�2�	)��,�,�.�"*�J�C���)�)�#�u�5�#+�/�
$)�C�K�K�� �/�.��
$)�C�K�K�� �s"�B�A;�B�;B�B�B N)rrr r!r r%r"r#r$rr�s��&�7�
)r#rc��eZdZd�Zy)�
TestHelperc��|jttjj�tt
j��yrs)r�sortedr5r�r�keyword�kwlistrns r$�
test_keywordszTestHelper.test_keywords�s-��������� 5� 5�6�����/�	1r#N)rrr r,r"r#r$r'r'�s��1r#r'c���eZdZd�Zej
eed�xrej�d�e	d���Z
ej
eed�xrej�d�e	d���Zej
eed�xrej�d�e	d���Zej
eed�xrej�d�e	d���Z
d�Zy	)
�PydocWithMetaClassesc�R�|jtjdt�yrirjrns r$rpzPydocWithMetaClasses.tearDown�r�r#r�r�c�>�Gd�dt�}Gd�d|��}td�tD��}t�}t	j
|��}||�ttf|ddzz}|j�j�}|j||�y)	Nc���eZdZ�fd�Z�xZS)�=PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Metac�.��|dk(ryt�|�|�S)N�ham�spam��super�__getattr__�rorGr�s  �r$r8zIPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.Meta.__getattr__�s����5�=�!��w�*�4�0�0r#)rrr r8�
__classcell__�r�s@r$�Metar2�s
���
1�
1r#r<c�0�eZdZejd��Zy)�;PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DAc��y)N�eggsr"rns r$r4z?PydocWithMetaClasses.test_DynamicClassAttribute.<locals>.DA.ham�s��r#N)rrr r)�DynamicClassAttributer4r"r#r$�DAr>�s��
�
(�
(�
�)�
r#rB��	metaclassc3�.K�|]
}|rd|znd���y�w)z	
 |      r'Nr"r)s  r$r,zBPydocWithMetaClasses.test_DynamicClassAttribute.<locals>.<genexpr>�s'����.I�/G�!�CD�l�Q�.>��.K�/G�r-r�r�)r�r��expected_data_docstringsrr5r��!expected_dynamicattribute_patternrrr7r)ror<rBr�rHrr�r�s        r$�test_DynamicClassAttributez/PydocWithMetaClasses.test_DynamicClassAttribute�s���	1�4�	1�
	�4�	�).�.I�/G�.I�)I�%�������V�,���r�
�9���;�B�Q�?�?�A�
����"�(�(�*�������/r#c��Gd�dt�}Gd�d|��}t�}tj|��}||�tt
z}|j
�j�}|j||�y)Nc�$��eZdZd�Z�fd�Z�xZS)�HPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Metac�
�gd�S)N)r�rr�LIFEr"�r�s r$�__dir__zPPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__dir__�s��F�Fr#c�.��|dk(ryt�|�|�S)NrMr�)r7�_Meta__getattrr9s  �r$r8zTPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.Meta.__getattr__�s����&�=���w�(��.�.r#�rrr rOr8r:r;s@r$r<rK�s���
G�
/�
/r#r<c��eZdZy)�IPydocWithMetaClasses.test_virtualClassAttributeWithOneMeta.<locals>.ClassNr�r"r#r$�ClassrT�r�r#rUrCr�)	r�rr5r��"expected_virtualattribute_pattern1rrr7r)ror<rUrHrr�r�s       r$�%test_virtualClassAttributeWithOneMetaz:PydocWithMetaClasses.test_virtualClassAttributeWithOneMeta�se��	/�4�	/�	�d�	�������V�,���u�
�:�X�E�
����"�(�(�*�������/r#c�(�
��Gd�dt��
Gd�dt��G�
�fd�d�
��}Gd�d�
�	�}Gd
�d||�	�}t�}tj|��}||�tt
z}|j
�j�}|j||�t�}tj|��}||�tt
z}|j
�j�}	|j||	�y)
Nc�$��eZdZd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1c�
�gd�S)N)r�rrr�r"rNs r$rOzQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__dir__����E�Er#c�.��|dk(ryt�|�|�S)Nr�r�r6r9s  �r$r8zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta1.__getattr__������%�<���w�*�4�0�0r#rRr;s@r$�Meta1rZ�����
F�
1�
1r#r_c�$��eZdZd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2c�
�gd�S)N)r�rr�twor"rNs r$rOzQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__dir__�r\r#c�.��|dk(ryt�|�|�S)Nrdr�r6r9s  �r$r8zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta2.__getattr__�r^r#rRr;s@r$�Meta2rb�r`r#rfc�,���eZdZ��fd�Z�fd�Z�xZS)�IPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3c
���tttgd��j|�z�j|�z���S)N)r�rr�three)r#r)�setrO)r�r_rfs ��r$rOzQPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__dir__sC����F�3�D��M�M�#�&�'�).���s�);�<�$=�>�?�?r#c�.��|dk(ryt�|�|�S)Nrjr�r6r9s  �r$r8zUPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Meta3.__getattr__s����'�>���w�*�4�0�0r#rR)r�r_rfs@��r$�Meta3rhs���
?�
1�
1r#rmc��eZdZy)�JPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class1Nr�r"r#r$�Class1ror�r#rprCc��eZdZy)�JPydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta.<locals>.Class2Nr�r"r#r$�Class2rr
r�r#rsr�)
r�rr5r��"expected_virtualattribute_pattern2rrr7r�"expected_virtualattribute_pattern3)rormrprsrHr�expected_text1�result1�expected_text2�result2r_rfs          @@r$�%test_virtualClassAttributeWithTwoMetaz:PydocWithMetaClasses.test_virtualClassAttributeWithTwoMeta�s����	1�D�	1�	1�D�	1�	1�E�5�	1�	�u�	�	�V�u�	�������V�,���v��;�h�F���/�/�#�)�)�+�������1�������V�,���v��;�h�F���/�/�#�)�)�+�������1r#c��Gd�dt�}Gd�d|��}t�}tj|��}||�tt
z}|j
�j�}|j||�y)Nc��eZdZd�Zy)�.PydocWithMetaClasses.test_buggy_dir.<locals>.Mc�
�gd�S)N)r�r�missing�herer"rNs r$rOz6PydocWithMetaClasses.test_buggy_dir.<locals>.M.__dir__!s��C�Cr#N)rrr rOr"r#r$�Mr} s��
Dr#r�c��eZdZdZy)�.PydocWithMetaClasses.test_buggy_dir.<locals>.Czpresent!N)rrr r�r"r#r$rr�#s���Dr#rrCr�)	r�rr5r��!expected_missingattribute_patternrrr7r)ror�rrHrr�r�s       r$�test_buggy_dirz#PydocWithMetaClasses.test_buggy_dirsg��	D��	D�	�!�	�������V�,���q�	�9�H�D�
����"�(�(�*�������/r#c��t�5}tjd�ddd�j�}|j	d|�y#1swY�,xYw)Nz	enum.Enumz
class Enum)rr5r�rr�)ror?r(s   r$�test_resolve_falsez'PydocWithMetaClasses.test_resolve_false,sB���
�'��J�J�{�#���#�#�%���
�
�l�H�-��
�s�A�AN)rrr rpr�r�r�rlr�rrHrWrzr�r�r"r#r$r.r.�s��3��X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��0��J�0�(�X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��0��J�0�"�X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��'2��J�'2�R�X�_�_�W�S�*�-�@�,�#�,�,�.�H�J��0��J�0�.r#r.c�8�eZdZd�Zd	d�Zd�Zd�Zd�Zd�Zd�Z	y)
�TestInternalUtilitiesc�H�tj�}|j|_tj
j
|jd�|_|j|j�t	j�x|_}dtj|g|_
y)N�nonexistentr')�tempfile�TemporaryDirectoryrG�argv0dirrQrRrl�argv0r\�cleanup�getcwd�
abs_curdir�curdir�curdir_spellings)ro�tmpdirr�s   r$r�zTestInternalUtilities.setUp7sj���,�,�.������
��W�W�\�\�&�+�+�}�=��
�������'�')�y�y�{�2���*�!#�R�Y�Y�
� ;��r#Nc�J�|�|j}tj||�Srs)r�r5�_get_revised_path)ro�
given_pathr�s   r$r�z'TestInternalUtilities._get_revised_path?s%���=��J�J�E��&�&�z�5�9�9r#c���tjj�}|jD]2}t	|j|��D]}|j
|���4|Srs)rlrR�copyr�r��countr�)ro�
clean_path�spelling�__s    r$�_get_starting_pathz(TestInternalUtilities._get_starting_pathFsQ���X�X�]�]�_�
��-�-�H��J�,�,�X�6�7���!�!�(�+�8�.��r#c��|j�}|jg|z}|j|j|�|�yrs)r�r�rr�)ror��
expected_paths   r$�,test_sys_path_adjustment_adds_missing_curdirzBTestInternalUtilities.test_sys_path_adjustment_adds_missing_curdirNs<���,�,�.�
����)�J�6�
�����/�/�
�;�]�Kr#c��|j�}|jg|z}|jg|z}|j|j	|�|�||jgz}|j|j	|�|�yrs)r�r�r�rr�)ror�r��leading_argv0dir�trailing_argv0dirs     r$�*test_sys_path_adjustment_removes_argv0_dirz@TestInternalUtilities.test_sys_path_adjustment_removes_argv0_dirSs{���,�,�.�
����)�J�6�
� �M�M�?�Z�7������/�/�0@�A�=�Q�&�$�-�-��8������/�/�0A�B�M�Rr#c����fd�}�j�}�jg|z}�jg|z}�j||�|�|�jgz}�jg|z}�j||�|�y)Nc�F���j|tj��S)N)r�)r�r5r6)r�ros �r$r�z\TestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir.<locals>._get_revised_path\s����)�)�*�E�N�N�)�K�Kr#)r�r�r�r)ror�r�r�r�r�s`     r$�+test_sys_path_adjustment_protects_pydoc_dirzATestInternalUtilities.test_sys_path_adjustment_protects_pydoc_dir[s����	L��,�,�.�
� �M�M�?�Z�7�����)�,<�<�
����*�+;�<�m�L�&�$�-�-��8�����)�,=�=�
����*�+<�=�}�Mr#c���|j�}|jD]�}|j|��5|g|z}|j|j	|��||gz}|j|j	|��|j
g|z}|j|j	|��||j
gz}|j|j	|��ddd���y#1swY��xYw)N)�curdir_spelling)r�r��subTestrsr�r�)ror�r��leading_curdir�trailing_curdirr�r�s       r$�5test_sys_path_adjustment_when_curdir_already_includedzKTestInternalUtilities.test_sys_path_adjustment_when_curdir_already_includedfs����,�,�.�
��-�-�H����h��7�"*��j�!8���!�!�$�"8�"8��"H�I�",��z�"9���!�!�$�"8�"8��"I�J�$(�M�M�?�^�#C� ��!�!�$�"8�"8�9I�"J�K�$3�t�}�}�o�$E�!��!�!�$�"8�"8�9J�"K�L�8�7�.�7�7�s�B-C*�*C3	rs)
rrr r�r�r�r�r�r�r�r"r#r$r�r�5s)��<�:��L�
S�	N�Mr#r�c��tj�}tjtjg|���tjt
�yrs)r
�threading_setupr��addModuleCleanup�threading_cleanupr)�thread_infos r$�setUpModuler�us8��"�2�2�4�K����.�@�@�O�;�O����m�,r#�__main__)arQrlr��importlib.utilrmr�r5rqr*rWr{rLr�r��test.support�testr)r r��
unittest.mock�urllib.parser��	xml.etreer��xml.etree.ElementTreer
�ior�collectionsr�urllib.requestrrrrr	�test.support.script_helperr
rrr
rrrrrrrr�test.support.os_helperrrr�test.test_pydocrrr�HAVE_DOCSTRINGSrFr7r�r�r�r��expected_html_data_docstringsr1rr�r�rGrVrtrur�r?rArJrNrVrXr_re�TestCasergr�r�rr�r�rrr'r.r�r�r�mainr"r#r$�<module>r�s���	�
���������	�����
��������"�.��&�"�M�M�)�E�E�E�<�;�%�'�	�	��<�<��� ��
 0��\�x
�E�G�y�|!&�&I�/G�&I�!I��M��^!&�&I�/G�&I�!I��,�-4�G�D�"�*�*�,E��N��%� 
�E�G�!"�$&�
�E�G�#�&�
�E�G�#�&�,
�E�G�-#�0%�
�E�G�"����"��	��	� �H�%�%� �FT	3�8�$�$�T	3�n[)�m�[)�|X
�x�(�(�X
�v
y<�h�'�'�y<�x������W�5��%,�h�'�'�%,�	�%,�P!)�-�!)�H1��"�"�1�q.�8�,�,�q.�h=M�H�-�-�=M�@-��z���H�M�M�O�r#

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists