Ë
    ü[;jü/  ã                   óÀ   — d Z ddlmZ ddlmZ ej                  Zej
                  Zej                  Z G d„ dej                  «      Ze	dk(  r ej                  «        yy)z!Tests for fire docstrings module.é    )Ú
docstrings)Ú	testutilsc                   óx   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚDocstringsTestc                 ón   — d}t        j                  |«      }t        d¬«      }| j                  ||«       y )NúA simple one line docstring.©Úsummary©r   ÚparseÚDocstringInfoÚassertEqual©ÚselfÚ	docstringÚdocstring_infoÚexpected_docstring_infos       ú]G:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\fire/docstrings_test.pyÚtest_one_line_simplez#DocstringsTest.test_one_line_simple   s8   € Ø2€IÜ×%Ñ% iÓ0€NÜ+Ø.ôÐð 	×ÑÐ,¨nÕ=ó    c                 ón   — d}t        j                  |«      }t        d¬«      }| j                  ||«       y )Nz(
      A simple one line docstring.
    r   r	   r   r   s       r   Útest_one_line_simple_whitespacez.DocstringsTest.test_one_line_simple_whitespace%   s<   € ð€Iô  ×%Ñ% iÓ0€NÜ+Ø.ôÐð 	×ÑÐ,¨nÕ=r   c                 ón   — d}t        j                  |«      }t        d¬«      }| j                  ||«       y )Nz”A one line docstring that is both a little too verbose and a little too long so it keeps going well beyond a reasonable length for a one-liner.
    z�A one line docstring that is both a little too verbose and a little too long so it keeps going well beyond a reasonable length for a one-liner.r	   r   r   s       r   Útest_one_line_too_longz%DocstringsTest.test_one_line_too_long/   s>   € ð€Iô  ×%Ñ% iÓ0€NÜ+ðôÐð
 	×ÑÐ,¨nÕ=r   c                 ón   — d}t        j                  |«      }t        d¬«      }| j                  ||«       y )NztA one line docstring that is both a little too verbose and a little too long
    so it runs onto a second line.
    úkA one line docstring that is both a little too verbose and a little too long so it runs onto a second line.r	   r   r   s       r   Útest_one_line_runs_overz&DocstringsTest.test_one_line_runs_over<   s>   € ð€Iô  ×%Ñ% iÓ0€NÜ+ð;ôÐð 	×ÑÐ,¨nÕ=r   c                 ón   — d}t        j                  |«      }t        d¬«      }| j                  ||«       y )Nz}
      A one line docstring that is both a little too verbose and a little too long
      so it runs onto a second line.
    r   r	   r   r   s       r   Ú"test_one_line_runs_over_whitespacez1DocstringsTest.test_one_line_runs_over_whitespaceI   s>   € ð€Iô  ×%Ñ% iÓ0€NÜ+ð;ôÐð 	×ÑÐ,¨nÕ=r   c                 ó    — d}t        j                  |«      }t        dt        dd¬«      t        dd¬«      g¬«      }| j	                  ||«       y )	Nz_One line description.

    Args:
      arg1: arg1_description
      arg2: arg2_description
    zOne line description.Úarg1Úarg1_description©ÚnameÚdescriptionÚarg2Úarg2_description©r
   Úargs©r   r   r   ÚArgInfor   r   s       r   Útest_google_format_args_onlyz+DocstringsTest.test_google_format_args_onlyU   sW   € ð€Iô  ×%Ñ% iÓ0€NÜ+Ø'ä˜Ð-?Ô@Ü˜Ð-?Ô@ð
ôÐð 	×ÑÐ,¨nÕ=r   c                 ó†   — d}t        j                  |«      }t        t        dd¬«      g¬«      }| j	                  ||«       y )Nz+
    Args:
      args: arg_description
    r)   Úarg_descriptionr#   )r)   r*   r   s       r   Ú!test_google_format_arg_named_argsz0DocstringsTest.test_google_format_arg_named_argsf   sI   € ð€Iô  ×%Ñ% iÓ0€NÜ+ä˜Ð->Ô?ð
ôÐð
 	×ÑÐ,¨nÕ=r   c           
      ó¨   — d}t        j                  |«      }t        ddt        ddd¬«      t        dd	d
¬«      gd¬«      }| j	                  ||«       y )Na*  Docstring summary.

    This is a longer description of the docstring. It spans multiple lines, as
    is allowed.

    Args:
        param1 (int): The first parameter.
        param2 (str): The second parameter.

    Returns:
        bool: The return value. True for success, False otherwise.
    úDocstring summary.úVThis is a longer description of the docstring. It spans multiple lines, as
is allowed.Úparam1ÚintúThe first parameter.©r$   Útyper%   Úparam2ÚstrúThe second parameter.z:bool: The return value. True for success, False otherwise.©r
   r%   r)   Úreturnsr*   r   s       r   Ú)test_google_format_typed_args_and_returnsz8DocstringsTest.test_google_format_typed_args_and_returnss   sl   € ð€Iô  ×%Ñ% iÓ0€NÜ+Ø$ð*ô ˜¨Ø 6ô8ä˜¨Ø 7ô9ð
ð MôÐð 	×ÑÐ,¨nÕ=r   c           
      ó¦   — d}t        j                  |«      }t        ddt        ddd¬«      t        dd	d
¬«      g¬«      }| j	                  ||«       y )Na  Docstring summary.

    This is a longer description of the docstring. It spans multiple lines, as
    is allowed.

    Args:
        param1 (int): The first parameter.
        param2 (str): The second parameter. This has a lot of text, enough to
        cover two lines.
    r1   r2   r3   r4   r5   r6   r8   r9   úHThe second parameter. This has a lot of text, enough to cover two lines.©r
   r%   r)   r*   r   s       r   Ú,test_google_format_multiline_arg_descriptionz;DocstringsTest.test_google_format_multiline_arg_description�   sh   € ð	€Iô  ×%Ñ% iÓ0€NÜ+Ø$ð*ô ˜¨Ø 6ô8ä˜¨ð!=ô>ð
ô	Ðð 	×ÑÐ,¨nÕ=r   c           
      óª   — d}t        j                  |«      }t        ddt        ddd¬«      t        dd	d
¬«      gdd¬«      }| j	                  ||«       y )NaD  Docstring summary.

    This is a longer description of the docstring. It spans across multiple
    lines.

    :param arg1: Description of arg1.
    :type arg1: str.
    :param arg2: Description of arg2.
    :type arg2: bool.
    :returns:  int -- description of the return value.
    :raises: AttributeError, KeyError
    r1   úNThis is a longer description of the docstring. It spans across multiple
lines.r!   r9   úDescription of arg1.r6   r&   ÚboolúDescription of arg2.z'int -- description of the return value.zAttributeError, KeyError)r
   r%   r)   r<   Úraisesr*   r   s       r   Ú&test_rst_format_typed_args_and_returnsz5DocstringsTest.test_rst_format_typed_args_and_returns©   sn   € ð€Iô  ×%Ñ% iÓ0€NÜ+Ø$ð"ô ˜ eØ 6ô8ä˜ fØ 6ô8ð
ð :Ø)ôÐð 	×ÑÐ,¨nÕ=r   c           
      ó¨   — d}t        j                  |«      }t        ddt        ddd¬«      t        dd	d
¬«      gd¬«      }| j	                  ||«       y )Na:  Docstring summary.

    This is a longer description of the docstring. It spans across multiple
    lines.

    Parameters
    ----------
    param1 : int
        The first parameter.
    param2 : str
        The second parameter.

    Returns
    -------
    bool
        True if successful, False otherwise.
    r1   rC   r3   r4   r5   r6   r8   r9   r:   z)bool True if successful, False otherwise.r;   r*   r   s       r   Ú(test_numpy_format_typed_args_and_returnsz7DocstringsTest.test_numpy_format_typed_args_and_returnsÆ   sk   € ð€Iô"  ×%Ñ% iÓ0€NÜ+Ø$ð"ô ˜¨Ø 6ô8ä˜¨Ø 7ô9ð
ð <ôÐð 	×ÑÐ,¨nÕ=r   c           
      ó¦   — d}t        j                  |«      }t        ddt        ddd¬«      t        dd	d
¬«      g¬«      }| j	                  ||«       y )Na&  Docstring summary.

    This is a longer description of the docstring. It spans across multiple
    lines.

    Parameters
    ----------
    param1 : int
        The first parameter.
    param2 : str
        The second parameter. This has a lot of text, enough to cover two
        lines.
    r1   rC   r3   r4   r5   r6   r8   r9   r?   r@   r*   r   s       r   Ú+test_numpy_format_multiline_arg_descriptionz:DocstringsTest.test_numpy_format_multiline_arg_descriptionè   sh   € ð€Iô  ×%Ñ% iÓ0€NÜ+Ø$ð"ô ˜¨Ø 6ô8ä˜¨ð!=ô>ð
ô	Ðð 	×ÑÐ,¨nÕ=r   c                 óp   — d}t        j                  |«      }t        dd¬«      }| j                  ||«       y )NzÄDocstring summary.

    This is the first section of a docstring description.

    This is the second section of a docstring description. This docstring
    description has just two sections.
    r1   zŸThis is the first section of a docstring description.

This is the second section of a docstring description. This docstring
description has just two sections.)r
   r%   r   r   s       r   Útest_multisection_docstringz*DocstringsTest.test_multisection_docstring  sA   € ð€Iô  ×%Ñ% iÓ0€NÜ+Ø$ð-ôÐð 	×ÑÐ,¨nÕ=r   c                 ój   — d}t        j                  |«      }| j                  d|j                  «       y )NztInspired by requests HTTPAdapter docstring.

    :param x: Simple param.

    Usage:

      >>> import requests
    z+Inspired by requests HTTPAdapter docstring.)r   r   r   r
   )r   r   r   s      r   Ú)test_google_section_with_blank_first_linez8DocstringsTest.test_google_section_with_blank_first_line  s5   € ð€Iô  ×%Ñ% iÓ0€NØ×ÑÐBØ#×+Ñ+õ-r   c                 ó2   — d}t        j                  |«       y )Nz‰Docstring summary.

    args: raises ::
    :
    pathological docstrings should not fail, and ideally should behave
    reasonably.
    )r   r   )r   r   s     r   Útest_ill_formed_docstringz(DocstringsTest.test_ill_formed_docstring%  s   € ð€Iô ×Ñ�YÕr   c                 ó\   — g d¢}dg}| j                  |t        j                  |«      «       y )N)ú   ú  foo  rT   rU   )r   r   Ú_strip_blank_lines)r   ÚlinesÚexpected_outputs      r   Útest_strip_blank_linesz%DocstringsTest.test_strip_blank_lines/  s)   € Ú%€EØ �k€Oà×Ñ�_¤j×&CÑ&CÀEÓ&JÕKr   c                 óÀ   — d}t        j                  |«      }t        dd t        ddd¬«      t        ddd	¬«      t        d
dd ¬«      g¬«      }| j	                  ||«       y )Nz£
     Greets name.

     Arguments
     ---------
     name : str
         name, default : World
     arg2 : int
         arg2, default:None
     arg3 : bool
     zGreets name.r$   r9   zname, default : Worldr6   r&   r4   zarg2, default:NoneÚarg3rE   r@   r*   r   s       r   Útest_numpy_colon_in_descriptionz.DocstringsTest.test_numpy_colon_in_description5  sn   € ð
	€Iô  ×%Ñ% iÓ0€NÜ+ØØä˜ eØ 7ô9ä˜ eØ 4ô6ä˜ f¸$Ô?ð
ô
Ðð 	×ÑÐ,¨nÕ=r   c           
      ó¾   — d}t        j                  |«      }t        dt        ddd¬«      t	        ddd	¬«      t	        d
dd¬«      g¬«      }| j                  ||«       y )NzÆDocstring summary.

    :param arg1: Description of arg1.
    :type arg1: str.
    :key arg2: Description of arg2.
    :type arg2: bool.
    :key arg3: Description of arg3.
    :type arg3: str.
    r1   r!   r9   rD   r6   r&   rE   rF   r[   zDescription of arg3.r(   )r   r   r   r+   Ú	KwargInfor   r   s       r   Ú%test_rst_format_typed_args_and_kwargsz4DocstringsTest.test_rst_format_typed_args_and_kwargsO  sn   € ð€Iô  ×%Ñ% iÓ0€NÜ+Ø$ä˜ eØ 6ô8ä˜6¨Ø"8ô:ä˜6¨Ø"8ô:ð
ô
Ðð 	×ÑÐ,¨nÕ=r   N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r,   r/   r=   rA   rH   rJ   rL   rN   rP   rR   rY   r\   r_   © r   r   r   r      s^   „ ò>ò>ò>ò>ò
>ò>ò">ò>ò8>ò4>ò: >òD>ò:>ò&-ò òLò>ó4>r   r   Ú__main__N)Ú__doc__Úfirer   r   r   r+   r^   ÚBaseTestCaser   r`   Úmainrc   r   r   Ú<module>ri      sc   ðñ (å Ý ð ×(Ñ(€Ø
×
Ñ
€Ø× Ñ €	ôJ>�Y×+Ñ+ô J>ðZ
 ˆzÒØ€)‡.�.Õð r   